Closed hkong closed 8 years ago
The ok
function can accept an argument. You can pass your name there. <button class="btn btn-primary" ng-click="ok(name)">{{data.ok}}</button>
The data will be available as a parameter to the .then
function
$confirm( data1, {templateUrl: 'dialog.html'})
.then(function(name) {
alert("You selected "+ name );
});
In addition you are not using select correctly. <select ng-options="item in data.list" ng-model="name" />
is the correct usage
Wow, thanks @Schlogen, this just made a great library that much more useful! You may want to add this to one of your examples, since it wasn't intuitive it can do this. Thanks again!
@hkong Ya that feature was added after I did the demo page. Any PRs will be welcome if you'd like to add it. It's on the gh-pages
branch.
Sure, I'll do that when I get a chance later tonight or tomorrow.
First, let me thank you for writing a good directive/service that is simple to use---solves 95% of my need for dialog boxes.
However, I have one use-case where I have this in my controller
and in a html file
I can see the selection I make in the div in the dialog box after I make a selection, but how do I get that value in the promise in the controller?
Thanks in advance.