angularjs - angular ui-router best practice inheritance vs metadata -


I am converting my application from ngRoute to uiRouter. I have read and seen a lot of tutorials, but I still lack the experience in making decisions about best practices.

At first I made a big change that breaks the state declaration to each module / controller. It seems more natural and cleaner to me, but many states want to introduce a global rule, while introducing some complexity. For example, half of my routes require authentication and the other half are not. With NgRoute I had a data attribute of the required atte level in each route, with the ureairer I think this is the way to do this and the state is the succession route. That's why a route may be public. My path is an abstract route declared at the public application level. This creates the issue, although the module is not working with any one person, if a person does not define a public position. On the contrary if I add the metadata attribute to the data object, such as "auth_level: user" it will not affect any module if no one is working with it, but it feels more "magic" and less conventional.

The same issue arises with the navigation bar. Half of my thoughts have a navigation bar and the second half is not there. So far I have used a havabervrivible boolean feature but I think it should be a part of the state? Instead of using ng-include with the Ng-if, can there be a second UI-view in the layout.html template?

In the end, I am thinking about the best practice to promise in each of the way to be resolved. For example, where the application entry point is nothing, the user before loading the scene Rights must be resolved first. In NGRT I was looping through all the means in my definition and adding this promise.

Is a good guide for best practices while migrating from NGRUT to Yuri Router, because with the general recommendation, "ng-" should be preferred with the name ui-view or the legacy of that state Should, I have not received any concrete implementation.

I am in the same position as compared to the author, how to drive this change, its There is some very interesting information about

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -