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 in string format as template , whereas others link all their directives to a templateUrl , even if the template is really simple and small. So, what is the best practice for deciding which one to use? I am personally more in favour of using templateUrl regardless of the template's complexity, just because I hate