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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -