Open chicoxyzzy opened 10 years ago
Use an input tag instead of a select tag and pass in some select2 options:
<input type="hidden" ui-select2="{query: query, minimumInputLength: 3}" ng-model="select2" data-placeholder="Select a song" />
example for the query function in your controller:
$scope.query = function (query) {
$http.get('http://ws.spotify.com/search/1/track.json', {
params: {
q: query.term
}
}).then(function(res){
var songs = { results: [] };
angular.forEach(res.data.tracks, function (song) {
songs.results.push({
text: song.artists[0].name + ' - ' + song.name,
id: song.href
});
});
query.callback(songs);
});
};
I am also not able to get the ajax functionality to work, at least with multiple=true set.
The problems I see are:
It seems to work if you revert to v0.0.4
I believe this is related to #136 and #143
I am trying to get it work all day. Does this functionality works in angular? Can someone provide an example if so?