Reputation: 163
<div ng-include="'blah.html'">
vs.
<blah> </blah>
What are the performance advantages to the latter?
Upvotes: 1
Views: 214
Reputation: 2067
In general, if you just want the content of the template, its faster to create a simple directive that just use templateUrl
. However, ng-include offers some advance features that a simple directive don't have such as the $includeContentLoaded
event and the onload
call back.
Here is the performance benchmark that prove templateUrl
is faster. dummy
is the simple directive
Upvotes: 1