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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -