Reputation:
In my application, I am trying to update the dialog box's text input value into the main controller.
$scope.dialogText
in main controller is set to the dialog box's text input.
Say, I enter pumpkin
in the dialog, and press ok, my app must show,
Dialog box's text comment is pumpkin
Instead it always shows,
Dialog box's text comment is
Jsfiddle is at, http://jsfiddle.net/HB7LU/22555/
Upvotes: 0
Views: 152
Reputation: 1273
your controller needs to be changed as below: -
myApp.controller('tmplCtrl', function($scope, ngDialog){
$scope.dialogText = ""
$scope.loadSuiteDlg = function(){
var prom = ngDialog.open({template : 'dialog', scope : $scope });
prom.closePromise.then(function(res){
$scope.dialogText = res.value;
});
};
});
Upvotes: 1