I'm trying to use ui-select
module in my system, I injected ui-module
and ngSanitize
angular.module('app', ['ngSanitize', 'ui.select']);
And included their JS
files in HTML
:
<link rel="stylesheet" href="/local/mentoring/assets/ui-select/dist/select.min.css">
<script src="/local/mentoring/assets/ui-select/dist/select.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular-sanitize.js"></script>
<div ng-controller="ctrl">
<ui-select ng-model="selected.value">
<ui-select-match>
<span ng-bind="$select.selected.name"></span>
</ui-select-match>
<ui-select-choices repeat="item in (itemArray | filter: $select.search) track by item.id">
<span ng-bind="item.name"></span>
</ui-select-choices>
</ui-select>
</div>
My JS:
angular.module('app')
.controller('ctrl', ['$scope', function ($scope){
$scope.itemArray = [
{id: 1, name: 'first'},
{id: 2, name: 'second'},
{id: 3, name: 'third'},
{id: 4, name: 'fourth'},
{id: 5, name: 'fifth'},
];
$scope.selectedItem = $scope.itemArray[0];
}]);
But when I'm using the directive, is reporting following error to me:
What I wrong in my code?
Update 1:
I changed angular.min.js
to angular.js
, then my console is reporting following error: