I am using ng-tags-input in AngularJS 1 for list of countries. I don't want to use the $http.get() for getting the tags. I have a static array of objects that I want to utilize in the tags.
Use the promise angular service in your load function:
$q(function (resolve, reject) {
resolve($scope.myArray);
}
This:
<auto-complete source="loadTags()"></auto-complete>
Would be:
$scope.loadTags = function () {
return $q(function (resolve, reject) {
resolve($scope.myArray);
};
};
$q
creates a promise and your plugin wants that.
Don't forget to include $q
in your dependencies.