AngularJS using the templateHtml path as the module name

I noticed that AngularJS UI Bootstrap uses the following approach for templates:

angular.module("uib/template/progressbar/bar.html", []).run(["$templateCache", function($templateCache) {
  $templateCache.put("uib/template/progressbar/bar.html" }

So, I think this is a pretty nice solution, but what is the reason for creating a module for each template, for example, angular.module("uib/template/progressbar/bar.html"or angular.module("uib/template/progressbar/progress.html"etc.

What benefits will he give us?

+4
source share
1 answer

. . , .

+1

Source: https://habr.com/ru/post/1685308/


All Articles