我遇到一个奇怪的问题,无法解决,即使在互联网上搜索后也无法得到很好的解释。
我有一个应用程序(网页),其中包含ui-bootstrap的accrodion元素,该元素通过$ http请求从json文件中获取数据。这部分工作正常。现在,我想添加一个多选下拉列表,并想使用ui-select中提供的元素。但是,当我在模块中添加依赖项“ ngSanitize”和“ ui-select”时,该应用程序将无法运行。我没有添加任何下拉元素,只是依赖项。我不明白问题出在哪里。
原始应用程序控制器
var app = angular.module('callApp', ['ui.bootstrap']);
app.controller('firstController', function($scope, $http, $modal, $log) {
//some functions are defined here
});
angular.module('callApp').service('popupService', function () {
//service is defined
});
然后我添加了依赖项ngSanitize和ui.select
var app = angular.module('callApp', ['ui.bootstrap', 'ngSanitize', 'ui.select']);
app.controller('firstController', function($scope, $http, $modal, $log) {
//some functions are defined here
});
angular.module('callApp').service('popupService', function () {
//service is defined
});
现在该应用程序无法正常工作。我没有修改任何其他功能或在html中添加任何元素。为什么会出现这样的问题?声明有什么问题吗?
您是否也将对js文件的引用添加到html页面中?
您在控制台中看到什么错误(按F12键)?
如果您的html中存在对js文件的引用,则只需检查路径是否正确指向实际路径即可。
问候,
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句