var app = angular.module('plunker', ['ngTagsInput']);
app.controller('MainCtrl', function($scope, $http) {
$scope.tags = [
{ id: 1, name: 'Tag1' },
{ id: 2, name: 'Tag2' },
{ id: 3, name: 'Tag3' }
];
$scope.loadTags = function(query) {
return $http.get('tags.json');
};
});
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<link rel="stylesheet" href="http://mbenford.github.io/ngTagsInput/css/ng-tags-input.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<script src="http://mbenford.github.io/ngTagsInput/js/ng-tags-input.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<tags-input ng-model="tags" display-property="name">
<auto-complete source="loadTags($query)"></auto-complete>
</tags-input>
<p>Model: {{tags}}</p>
</body>
</html>
[
{ "id": 1, "name": "Tag1" },
{ "id": 2, "name": "Tag2" },
{ "id": 3, "name": "Tag3" },
{ "id": 4, "name": "Tag4" },
{ "id": 5, "name": "Tag5" },
{ "id": 6, "name": "Tag6" },
{ "id": 7, "name": "Tag7" },
{ "id": 8, "name": "Tag8" },
{ "id": 9, "name": "Tag9" },
{ "id": 10, "name": "Tag10" }
]