-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Modals that contain directives that require outer controller fail #3765
Comments
Proposed solution for angular-ui#3765
Hi Robin, |
From what I can tell in this short time it's basically an implementation issue. I'm still researching if this is an enhancement request or just a question that should be asked on StackOverflow. That's why I put it there and didn't close it right away. |
Thanks Robin. I think that the current implementation does not allow what I Therefore I created a possible solution, On Fri, Jun 5, 2015 at 3:24 PM, Robin van Baalen [email protected]
|
In my opinion, a modal should be self containing without parent controller dependencies. I'll ask some team members to take a look at this issue and make sure we're all on the same page. |
I do not believe we should support this. If a custom template is wanted, why not just specify this in a template and load the template with the $modal service? This use case also has the additional issue that it is cumbersome to work with in general due to template clutter of mixed concerns. I am inclined to reject this suggestion and close the issue, but I also would like to hear another opinion. @chrisirhc @RobJacobs @Foxandxss ? |
Hm.. I considered supporting this but it'll be tricky. The tricky part about this is is dealing with covering all the elements on screen. This is going to be very difficult to support. |
Problem: when a modal template contains directives that require an outer controller, this outer controller must be present in the template otherwise it will fail.
I have created a test case here: http://embed.plnkr.co/UN5gqhrdZXHmWbqDA6Xg/preview
Clicking 'Open Popup' opens the modal. Then clicking 'ok' should call a function from a required outer controller. Unfortunately it will not be found.
Reason for failure: the $modalStack.open function compiles the template content directly on the page body.
A solution would be to use a 'futureParentEl' as the parent instead of the html-body, when available.
See: 50a561a
The text was updated successfully, but these errors were encountered: