-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Modals within ng-repeat creates a bunch of duplicate HTML #160
Comments
You should definitely use a service for this. |
Ah ha! I knew there had to be more to the story. Perfect, I'll use that for now, but yes maybe consider this "issue" to be a request to improve the discovery of this. Better docs is good, but actual functions is nice too because then I would have found them in the debugger :) |
@lightbody the var modalPromise = $modal({
template: 'partials/modal.html',
persist: true,
show: false,
backdrop: 'static',
scope: $scope
});
$scope.showModalViaService = function() {
$q.when(modalPromise).then(function(modalEl) {
modalEl.modal('show');
});
}; I've updated the docs to make it more clear. Still we may want to pass another object when the promise is resolved. |
I think that's a good idea. ^ [decided to ask another modal question in a new issue since it's a bit more involved.] |
The AngularStrapv2.0.0-beta.1 has been released with a new version of this plugin. The former version is now both deprecated and unsupported. Please try to reproduce your issue against the master branch. Thanks! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have an app that iterates over a list of widgets and offers an "edit widget" link next to each one. I am using bs-modal to pop up a dialog box for editing each widget. This works fine, but I noticed that if I have N widgets I end up with N copies of the modal HTML.
I was hoping the $modal service would let me find a way to re-use the HTML, but I've had no such luck. Any suggestions?
Related to this, I can't really tell what the point of the Modal variable is that gets returned by $modal. It doesn't seem to have any functions on it, such as show() or hide() so it's not clear. Similarly, I don't see the point of passing in "show: false" on $modal, since if I don't show it I have no known way to show it later :)
The text was updated successfully, but these errors were encountered: