angular.js - angular 单页面开发怎么样?
巴扎黑
巴扎黑 2017-05-15 16:51:03
0
2
566

目前要开发一个web应用,采用spa单页面开发适合吗?通过angular ui进行route 有什么优点和缺点吗?~

巴扎黑
巴扎黑

reply all(2)
Peter_Zhu

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.

刘奇

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template