Templateurl Vs Template In Angularjs
I think for routing, templateUrl should always be used over template. But for a directive, when should templateUrl be used instead of template? I see some people use chunks of HTML
Solution 1:
It cones down to preference, really. In general I agree with you, and more complex markup always makes more sense in a separate template due to ease of editing.
Solution 2:
I wrote a blog post about this: http://www.smarpshare.com/angular-template-vs-templateurl-the-move-toward-true-modular-development/ . In a nutshell, I find it is better to use dependency management system and template
to organize your Angular project; it will help you to migrate to Angular 2 too!
Post a Comment for "Templateurl Vs Template In Angularjs"