admin管理员组文章数量:1415476
Hi im trying to implent uiSelect
But when i add module JS
angular.module('projects').controller('ProjectsCreateController', ['$scope', 'Projects', 'Notify', 'CustomersToId', 'Users', '$http', '$q', 'uiSelect',
function($scope, Projects, Notify,Customers, Users, $http, $q, uiSelect) {
HTML
<ui-select-match placeholder="Select person...">
{{customers.name}} <{{customers._id}}>
</ui-select-match>
I get this error in chrome console
Error: [$injector:unpr] Unknown provider: uiSelectProvider <- uiSelect
.2.27/$injector/unpr?p0=uiSelectProvider%20%3C-%20uiSelect
at ...lib/angular/angular.js:78:12
at .../lib/angular/angular.js:3801:19
at Object.getService [as get] (.../lib/angular/angular.js:3929:39)
at .../lib/angular/angular.js:3806:45
at getService (.../lib/angular/angular.js:3929:39)
at invoke (.../lib/angular/angular.js:3956:13)
at Object.instantiate (.../lib/angular/angular.js:3976:23)
at .../lib/angular/angular.js:7307:28
at .../lib/angular/angular.js:6696:34
at forEach (.../lib/angular/angular.js:332:20) <div class="modal-content" modal-transclude="">
Hi im trying to implent uiSelect https://github./angular-ui/ui-select
But when i add module JS
angular.module('projects').controller('ProjectsCreateController', ['$scope', 'Projects', 'Notify', 'CustomersToId', 'Users', '$http', '$q', 'uiSelect',
function($scope, Projects, Notify,Customers, Users, $http, $q, uiSelect) {
HTML
<ui-select-match placeholder="Select person...">
{{customers.name}} <{{customers._id}}>
</ui-select-match>
I get this error in chrome console
Error: [$injector:unpr] Unknown provider: uiSelectProvider <- uiSelect
http://errors.angularjs/1.2.27/$injector/unpr?p0=uiSelectProvider%20%3C-%20uiSelect
at ...lib/angular/angular.js:78:12
at .../lib/angular/angular.js:3801:19
at Object.getService [as get] (.../lib/angular/angular.js:3929:39)
at .../lib/angular/angular.js:3806:45
at getService (.../lib/angular/angular.js:3929:39)
at invoke (.../lib/angular/angular.js:3956:13)
at Object.instantiate (.../lib/angular/angular.js:3976:23)
at .../lib/angular/angular.js:7307:28
at .../lib/angular/angular.js:6696:34
at forEach (.../lib/angular/angular.js:332:20) <div class="modal-content" modal-transclude="">
Share
Improve this question
asked Jan 19, 2015 at 8:42
StweetStweet
7133 gold badges12 silver badges27 bronze badges
1 Answer
Reset to default 5You don't need to inject uiSelect
into your controller so first remove it.
angular.module('projects').controller('ProjectsCreateController', ['$scope', 'Projects', 'Notify', 'CustomersToId', 'Users', '$http', '$q',
function($scope, Projects, Notify,Customers, Users, $http, $q) {
ui.select
needs to be added to your module when your module is declared. You also need to include ng-sanitize
.
var module = angular.module('projects', ['ui.select', 'ngSanitize']);
Make sure you also include ng-sanitize
javascript file:
<script src="//ajax.googleapis./ajax/libs/angularjs/1.3.9/angular-sanitize.js"></script>
This information is available in the Getting Started documentation.
本文标签: javascriptuiSelect Unknown providerStack Overflow
版权声明:本文标题:javascript - uiSelect Unknown provider - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745192663a2646984.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论