20 ms·
. > Resolve promises in router, defer controllers Absolutely not,you want to display something while you query the server.using resolve will block the router
by aikah 12y ago
.
> Resolve promises in router, defer controllers
Absolutely not,you want to display something while you query the server.using resolve will block the router and not display the next view up until the promise is fullfield or rejected.It's perfectly fine to limit the router to routing and not stuffing it with business logic.
> Project/file structure
Wrong again, group files by modules/features ,dont put 1 service per file or one controller per file.We are not writing java packages here, but javascript modules.
At least you admit it is opinionated ,but at lest half of your opinions shouldnt even be followed.
- john2go1 12y agoUsing resolve is by far the best option, the creator of Angular wanted a way to do this and the feature landed: http://stackoverflow.com/questions/11972026/delaying-angularjs-route-change-until-model-loaded-to-prevent-flicker http://stackoverflow.com/questions/11972026/delaying-angular... Structuring files/folders is debatable based on code base size/estimation, no opinion is "wrong".
- deleted 12y ago[deleted]
- kyllo 12y agoStructuring files/folders is debatable based on code base size/estimation, no opinion is "wrong". Yep, that's why he labeled both ways as "good".
- hughes 12y agoStructuring files/folders this way is great for managing dependencies and compiling sub-apps (eg. with requirejs). If I find myself in a situation where I need to load MainCtrl but I don't need AnotherCtrl, why would I load both?