ng-dialog

ngDialog $scope variables not being updated by ngModel fields in $dialog when using scope: $scope

为君一笑 提交于 2019-12-18 21:31:14
问题 I have a controller that creates a dialog with ngDialog.open. I assign scope:$scope and set scope variables with ng-model in the popup $dialog. However the values are not set in the controller $scope. The ng-click function is able to call a function in the $scope. Is there something I am missing, I have searched quite a bit on here and github, read the docs and worked with all the examples provided on github in the project. JS Fiddles below explains. It shows that the scope:$scope is not what

AngularJS validation and promises

*爱你&永不变心* 提交于 2019-12-13 02:26:35
问题 In an Angular app, form is validated via custom JS function before submitting. Based on a condition, I need to show a confirmation dialog to the user, wait for confirmation or rejection, then proceed with validation. I'm having difficulties with achieving this asynchronously. I believe I am not using the promise correctly, but not sure what needs to be updated. Factory app.factory("confirmDialogService", ['$q', 'ngDialog', function ($q, ngDialog ) { return { popConfirm: function () { var

Accessing elements inside ng-template

北城以北 提交于 2019-12-11 13:18:07
问题 <script type="text/ng-template" id="popupTemplate"> <div id="myPopup"> <input type="checkbox" name="backup"/><label for="backup">Backup</label> </div> </script> I want to access the popup div from outside script for adding more check boxes dynamically. I tried using jQuery $("#myPopup") but it is not accessing the element. Is there any way to achieve this? 回答1: The template written inside <script type="text/ng-template"></script> will be stored in $templateCache with the given id. Retrieve

ngDialog $scope variables not being updated by ngModel fields in $dialog when using scope: $scope

我是研究僧i 提交于 2019-11-30 18:28:40
I have a controller that creates a dialog with ngDialog.open. I assign scope:$scope and set scope variables with ng-model in the popup $dialog. However the values are not set in the controller $scope. The ng-click function is able to call a function in the $scope. Is there something I am missing, I have searched quite a bit on here and github, read the docs and worked with all the examples provided on github in the project. JS Fiddles below explains. It shows that the scope:$scope is not what it seems for .open(). It is a one way binding and does not go back to $scope. .openConfrm() seems to