javascript - AngularUI Modal dialog not working -
i'm trying include angularui modular dialog in app
in controller.js
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; });
i've added ui.bootstrap.dialog angular module in app.js
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']);
now, keep hitting typeerror: object # has no method 'dialog' @ object.$scope.opendialog error.
what doing wrong?
the order in list dependencies order passed controller function. since $dialog
third entry in dependencies array, should third argument in function.
Comments
Post a Comment