I'm currently facing an issue with a controller that uses ngDialog.open to create a dialog box. I've assigned scope:$scope and set variables using ng-model within the popup $dialog, but for some reason, these values are not getting set in the controller's $scope. Although the ng-click function can successfully call a function within the $scope.
I've searched extensively on various platforms including here, Github, read through documentation, and experimented with examples provided on GitHub in the project.
Below are two JS Fiddles that showcase the problem. It seems like the binding with scope:$scope in .open() is one-way and doesn't reflect back onto $scope. However, .openConfrm() behaves as expected.
ngDialog.open() - http://jsfiddle.net/s1ca0h9x/ (FIXED!! works as expected)
ngDialog.openConfirm() - http://jsfiddle.net/tbosLoa9/ (works correctly)
var myApplication = angular.module('myApplication', ['ngDialog']);
myApplication.controller('MainController', function ($scope, ngDialog) {
$scope.FormData={newAccountNum:''};
$scope.ShowNgDialog = function () {
ngDialog.open({
template: '<div><input type="text" ng-model="FormData.newAccountNum"/></div>',
plain: true,
scope:$scope
});
}
});