angular.js - ng-view和ng-include之间的区别是什么?两者适用的情况分别是什么?
某草草
某草草 2017-05-15 16:53:23
0
2
615

angular新手~
ng-view和ng-include之间的区别是什么?两者适用的情况分别是什么?

某草草
某草草

reply all(2)
巴扎黑

http://stackoverflow.com/questions/20025101/how-to-decide-when-to-use-...
Simply put,
Use ng-view. This method can easily implement page combination by using routing control. But this method also has a major disadvantage, that is, there can only be one ng-view in an html file. There are workarounds though. He can be controlled by ctl.
ng-include extracts common pages from multiple pages, such as header.html, footer.html, etc., and introduces them with <dv ng-include="header.html"></p> on each page.

習慣沉默

I personally tested it, and regarding ng-include的说法不太对,用法应该是<p ng-include="'header.html'">, there should be a single quotation mark in the middle. Reference from: http://www.runoob.com/angular...

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