Wednesday 11 September 2019

javascript - ui router vs ngroute for sinlge page app



I am starting a new angular project(a single page app), which will have complex views (dialogs, wizards, popups, loaders), though exact requirements are not so clear at the moment.




Should I use ui.router upfront ? Or should I begin with ngRoute and change to ui.router when needed ?



What benefit ui.router has over ngRoute ? What are the limitations that may make me to opt for ui.router instead ?



From my research it seems ui.router does lot more than ngRoute, I would try to avoid the complexity as long as possible.



I read What is the difference between angular-route and angular-ui-router?, but doesnt really help (me being a total angular noob).



I have fine skills in js,jquery,html though.


Answer




I suggest go ahead with ui.router, why ?




  • its almost as complex as ngRoute


  • it will better allow you to use same view in a page, popup, or container within another page


  • more readable code





    vs




    book.chapter({chapter : chapter.name})


  • and you would observe the power of ui.router more, as you dive deeper into angular.




Trying to keep it simple, given you are an "angular noob" :-).


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...