angular.js - How to implement angular single-page application
为情所困
为情所困 2017-05-15 16:52:47
0
2
662

I have done a single-page project before, and I used ng-include to include all pages into the homepage.
In fact, I felt that this idea was not quite right at the time. I felt that ng-include should be used to include some public pages that are divided into pages, such as page headers and footers.
These are just two opposite ideas.
So my question is
1. Is the idea of ​​using ng-include for single-page applications correct? Is the correct usage of ng-include to include public parts of code?
2. If ng-include is not used, what should be used to write a single-page application?

Original question: Correct usage of ng-include

为情所困
为情所困

reply all(2)
淡淡烟草味

This question can be extended to the use of angular templates.
Use of templates: http://www.zhihu.com/question/21635146/answer/18967226
Refer to Zhihu source code: view-source:http://zhuanlan.zhihu.com/Weekly/19620215
angular routing: http://my.oschina.net/tanweijie/blog/295111
Angular routing implementation: http://blog.csdn.net/violet_day/article/details/16974467
Keywords: ng-template, routeProvider

1. Is the idea of ​​using ng-include for single-page applications correct? Is the correct usage of ng-include to include public parts of code?
It is not.
2. If ng-include is not used, what should be used to write a single-page application?
angular routing routeProvider
Angular front-end routing exists independently of the server, and nested views can use ui-router.

巴扎黑

http://stackoverflow.com/a/17544706/2586541

http://www.bennadel.com/blog/2441-nested-views-routing-and-deep-linkin...

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