-
Notifications
You must be signed in to change notification settings - Fork 27.4k
onload for ng:view #743
Comments
We need a better solution than onload. The onload fn often needs to access It would be great if we could somehow move this responsibility to a |
With new compiler, we have pre/post link, right ? So if understand it correctly, a directive can registers a post link fn... |
Post link fn is good for directives with a single template. Both ng-view |
Yep. Well then, we ng:include/ng:view might fire and event on scope... |
May I participate here ? :-) @igor, So [PostLink] fn would be great, I think. Why not use the pre/post link fn whenever the source url changes? |
On Mon, Feb 6, 2012 at 4:21 AM, Thomas Burleson <
absolutely!
are you referring to this: https://gist.github.com/1751792 ? I see two problems there:
the post link fn Vojta mention is part of the api of the new html compiler
as I originally stated, this forces the developers to do dom manipulation |
I understand (and agree) with the axiom that "Controllers should not directly manipulate views... except via databinding and expressions". The issue here is that the views should not be considered static or CRUD GUIs. Views are [usually] much more dynamic. Some layer is needed to transform static layout to rich layout while conformant to MVVM and delegation solutions. This same issue, btw, exists in Flex and Flash architectures. What the Flex dev team created was a concepts of "state, state management, and transitions". State was a representative of layout and content. Custom states extend base states with element modifications/adds/deletes, skin changes, layout changes, interaction changes. Transitions could be attached to changes of state. Really powerful. This is what needs to be added to Angular: state management overlayed on partials. State changes could be triggered via Controller values/expressions. Transitions could be programmatic or CSS3. I have been thinking about this a lot lately... once I am more acclimated to AngularJS, I would be interested in implementing this for the AngularJS team. |
@IgorMinar I got it and agree. @ThomasBurleson I'm not that much familiar with Flex, but it sounds like you might have a "state" object on scope (this object would hold multiple information for template) and you could exchange the whole state object. |
+ refactor unload to listen on this event -> we can use unload with ng:view as well Closes angular#743
Same as ng:include - execute after content is compiled...
The text was updated successfully, but these errors were encountered: