【发布时间】:2017-08-11 07:48:30
【问题描述】:
您好,我正在使用 ASP.NET MVC 和 Angular js 创建应用程序。
一切运行良好,但是当我想将任何第三方 js 用于 angular js 时,它不允许这样做......
我已经创建了三个js文件。
1) app.js
var app;
(function () {
app = angular.module("ANG", []);
app.factory('GlobalService', function () {
return {
urlBase: 'myserviceurl/',
UserName: '',
UserRole: ''
};
});
})();
2) Controller.js
app.controller("CustomerCtrl", ["$scope", "$q", "VendorService", "CustomerService", "$filter", function ($scope, $q, vendorService, customerService, $filter){
//My code here
}
]);
3) Service.js
app.service('VendorService', ["$http", "$q", "GlobalService", function ($http, $q, globalService) {
//My service calling
}]);
4) 在视图中实现
<html lang="en" id="htmlMainPage" ng-app="ANG">
我想用multiselectionjs实现多选下拉列表。
我只做了以下一行的更改,并在控制器中查看了进一步的更改。
app.js
app = angular.module("ANG", ["angularjs-dropdown-multiselect"]);
它也运行良好,但也使用此 app.js 的其他页面给了我一个错误。
【问题讨论】:
-
你在哪里给出了多选js的参考?
-
在视图页面中我的意思是我只需要在页面中的位置。
标签: angularjs asp.net-mvc angularjs-injector angular-route-segment