Javascript AngularUI模式对话框不工作
我正在尝试在我的应用程序中包含一个angularui模块化对话框 在my controller.js中Javascript AngularUI模式对话框不工作,javascript,angularjs,angular-ui,Javascript,Angularjs,Angular Ui,我正在尝试在我的应用程序中包含一个angularui模块化对话框 在my controller.js中 define([ 'app' ], function(app) { app.controller('TeacherClasses', [ '$scope', '$http', '$dialog','$location', 'anotherservice', function($scope, $http, $location, $dialog, anotherservice) { $
define([ 'app' ], function(app) {
app.controller('TeacherClasses',
[ '$scope', '$http', '$dialog','$location', 'anotherservice',
function($scope, $http, $location, $dialog, anotherservice) {
$scope.opts = {
backdrop: true,
keyboard: true,
backdropClick: true,
template: '/pathto/partial.html'
};
$scope.openDialog = function(studentGroup){
$scope.newClass = angular.copy(studentGroup);
var modal = $dialog.dialog($scope.opts);
modal.open();
}
}]);
return app;
});
我已经将ui.bootstrap.dialog添加到app.js中的angular模块中
var myModule = angular.module('myApp',
[ 'ngResource', 'ui', 'infinite-scroll', 'ngDragDrop', 'blueimp.fileupload','ui.bootstrap.dialog', 'ui.bootstrap.modal',
'ui.bootstrap.dropdownToggle', 'LoadingIndicator', 'http-auth-interceptor']);
现在,我一直遇到一个类型错误:Object#在Object上没有方法'dialog'。$scope.openDialog错误
我做错了什么?列出依赖项的顺序是它们传递给控制器函数的顺序。由于
$dialog
是依赖项数组中的第三个条目,因此它应该是函数中的第三个参数。列出依赖项的顺序是它们传递给控制器函数的顺序。由于$dialog
是依赖项数组中的第三个条目,因此它应该是函数中的第三个参数。很好,谢谢。我永远也不会明白。我想我需要先把重点放在基础上。谢谢你的帮助:)没问题。祝你好运:)行得通,谢谢。我永远也不会明白。我想我需要先把重点放在基础上。谢谢你的帮助:)没问题。祝你好运:)