angularjs - Angular.js return scope property from modal -
In this Angular.js directive, I try to return ng-model = "commentBox" modalInstance.result.then (the function (result) {}
on the controller but I do not think it seems to be emitting from the model with the resolution
.
Director:
angular.module ('main.vips'). Instructions ('deleted buttons', function ($ modal) {var confirmModal = function TheScope) {return $ Modal.open ({Template Temple: '... /confirm_modal.html', Area: The Scope, Resolution: {cbox: function () {return theScope.commen TBox;}}, backdrop: incorrect}}}} {templateUrl: return} Vips / directives / delete_button.html ', restrict: "AE", scope: {' iconAttribute ': "@",}, controller: function $ Scop e, $ element, $ attrs) {var modalInstance; $ Scope.cancel = function} {modalInstance.dismiss}} $ Scope.ok = function (strengthModel) {modalInstance.close (); ModalInstance.result .then (function (result) {console.log (results);}, function () {console.log ("dddddddddddddD");}); } $ Element.on ("click", function (event) {modalInstance = confirmModal ($ scope);}); }}});
Template:
& lt; Div class = "modal-header" style = "background-color: # E9E6E6" & gt; & Lt; H3 class = "model-title" & gt; Confirm & lt; / H3 & gt; & Lt; / Div & gt; & Lt; Div class = "modal-body" & gt; & Lt; P & gt; Your change will be logged. Please provide a ticket number or comment for reference & lt; / P & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "span4" & gt; & Lt; Textarea type = "text" class = "form-control" ng-model = "comment box" & gt; & Lt; / Textarea & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "modal-footer" style = "background color: # E9E6E6" & gt; & Lt; Button type = "button" class = "btn btn-primary" ng-click = "ok ()"> gt; OK & lt; / Button & gt; & Lt; Button type = "button" class = "btn btn-primary" ng-click = "cancel ()" & gt; Cancel & lt; / Button & gt; & Lt; / Div & gt;
You probably want to create your code like this: or this:
Comments
Post a Comment