I've seen that you can ensure that all data is present in a single-page 
application by returning promises from services and controllers so the 
router will only fire the controller if all dependencies are resolved. This 
is described here: 
http://stackoverflow.com/questions/27238928/angularjs-http-call-in-a-service-return-resolved-data-not-promises

My issue is now that I don't have a single-page app and that what I'm 
trying to do doesn't work well because my directives try to work with data 
that is not yet present when the primary directive is loaded. We can't turn 
the current application in a single-page app yet and I think angular isn't 
made exclusively for single page apps, right? I've read this 
article 
http://www.technofattie.com/2014/03/21/five-guidelines-for-avoiding-scope-soup-in-angular.html
 
and trying to follow it.

http://plnkr.co/edit/eCRnan8Nzc9akztQRiN9?p=preview

If you look at my plunker I think you'll get an idea of what I'm trying to 
do. I want to load a complete page (the page data) and then manipulate it 
using AngularJS. The basic concept is that a page has sections and each 
section has elements. All the data is stored server side in a database. We 
wan't to try to keep the layouts in which the elements get rendered as easy 
to use as possible for none programmers so that they can use a minimal set 
of custom directives, you can see that by looking at my index.html of the 
plunker.

Also, is my whole approach a good one? I still struggle with getting and 
sharing the data across all my nested directives. Any advice is welcome!





-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to