Javascript 针对RequireJS的AngularJS视图构建?

Javascript 针对RequireJS的AngularJS视图构建?,javascript,angularjs,requirejs,Javascript,Angularjs,Requirejs,Angular对于.html部分有很好的视图注入,但对于生产来说,它的性能不是最佳的 我见过一些指令,如angularui使用模板缓存,如: angular.module("template/alert/alert.html", []).run(["$templateCache", function($templateCache) { $templateCache.put("template/alert/alert.html", "<div class='alert' ng-c

Angular对于.html部分有很好的视图注入,但对于生产来说,它的性能不是最佳的

我见过一些指令,如angularui使用模板缓存,如:

 angular.module("template/alert/alert.html", []).run(["$templateCache", function($templateCache) {
  $templateCache.put("template/alert/alert.html",
   "<div class='alert' ng-class='\"alert-\" + (type || \"warning\")'>\n" +
   "<button ng-show='closeable' type='button' class='close' ng-click='close()'>&times;</button>\n" +
   "<div ng-transclude></div>\n" +
   "</div>\n" +
   "");
}]);
   // ngview will be used in production 
   // mode to map view dependencies but 
   // not used in development mode
   define(['myapp', 'ngview!home'], function(){ ... });
然后在内置文件中生成templateCache对象


有什么想法吗?

虽然这不是特定的要求,但grunt有一个任务叫做