angularjs - Pass data to ngDialog in Angular -


how can pass data ngdialog in angular? examples using scope this. don't use scope in controller. should do? here code inside controller:

var vm = this; authservice.login(user.name,user.password).then(function() {       $state.go('dashboard');     },function(error) {       vm.user.password = '';       ngdialog.open({         template: '<h2>error</h2><p>{{error}}</p>',         plain: true       });     }) 

any idea? thanks.

you using resolve same way routers. whatever properties define in resolve can injected controller

ngdialog.open({     template: '<h2>error</h2><p>{{error}}</p>',     plain: true,     resolve:{        error: function(){             return error;         }     },     controller: function($scope,error){         $scope.error = error;     }   }); 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -