サードパーティの API にクエリを実行する小さなコードがあります。これですか:
angular.module('myApp', ['ngResource'])
function Hello($scope, $http) {
$http.get('http://api.discogs.com/database/search?type=artist&q=alva-noto&page=1&per_page=200').
success(function(data3) {
$scope.results = data3.results;
});
};
HTML 側では、現在、1 つの特定の検索に基づいて、li に ng-repeat を使用して UL を表示しています。そのようです:
<h1>Search</h1>
<ul>
<li ng-repeat="result in results">{{result.title}}</li>
</ul>
私の質問は、内部に書かれたテキストを検索クエリにバインドする入力フィールドを作成するにはどうすればよいですか? 文字列を ?=string に導入するように:
$http.get('http://api.discogs.com/database/search?type=artist&q=string&page=1&per_page=200')
何かご意見は?
ありがとう!エリック