search

Home  >  Q&A  >  body text

angular.js - What about single page development in angular?

We are currently developing a web application. Is it suitable to use spa single page development? Are there any advantages and disadvantages of routing through angular ui? ~

巴扎黑巴扎黑2776 days ago584

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-15 16:53:03

    More than just appropriate, this is what he does.

    The following are the advantages, the disadvantage is that development becomes complicated.

    http://jishu.zol.com.cn/17898.html
    In single-page applications, jumping between views is particularly important. As applications become more and more complex, we need a method to precisely control when and which page should be presented to the user.
    We can support switching between different pages by introducing different templates into the main page, but the disadvantage of this is that more and more embedded codes make it difficult to manage in the end.
    We can integrate many templates into the view through the ng-include directive, but we have a better way to handle this situation. We can break up the view into layout and template views, and then based on the specific URL visited by the user. Display the required view.
    We can join these "pieces" together in a layout template.
    AngularJS implements the above idea by declaring routes on $routeProvider (the provider of the $route service).
    Using $routeProvider, we can better utilize the browsing history API and allow users to save the current path as a bookmark for future use.

    reply
    0
  • 怪我咯

    怪我咯2017-05-15 16:53:03

    In fact, Angular and Ember are already suitable for large-scale application development, and any application can be developed using single-page technology. The main problems are resource loading, memory management and so on. There is no doubt that Angular and the like can greatly reduce repeated resource loading and improve fluency.
    As for ui-router, it is a more powerful router. See if you need to use it. If there are only a few pages and no nested views, there is no need to use ui-router. If it's complex, it's better to use ui-router.

    reply
    0
  • Cancelreply