New to angular~
What is the difference between ng-view and ng-include? What are the applicable situations for both?
巴扎黑2017-05-15 16:55:23
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.
習慣沉默2017-05-15 16:55:23
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...