javascript - How to inject $dialog into existing angularjs page controller -
i want create simple pop-up dialog in angularjs using bootstrap-ui's $dialog directive.
i $dialog undefined, when try inject controller. can provide hint on "how inject $dialog" following design , invoke create pop-up dialog?
thanks in advance
index.js:
angular.module('myapp', ['myapp.core','myapp.templates','ui.router', 'ui.bootstrap', 'angularchart', 'angularjs-dropdown-multiselect', 'smart-table', 'angularmodalservice']);
page controller:
(function() { 'use strict'; angular.module('myapp').controller('page3controller', page3controller); function page3controller( $scope, $dialog, // undefined page3service, utility) {
as accepted answer of this post says, $dialog
service refactored $modal
version 0.6.0 of ui-bootstrap
. functionality $dialog
should still available, through $modal
instead.
inject $modal
service within module , should work. read docs
so, edit code,
(function() { 'use strict'; angular.module('myapp').controller('page3controller', page3controller); function page3controller( $scope, $modal, // whatever want, refer docs detailed change page3service, utility) {
please check if working way.
Comments
Post a Comment