在路由配置上添加脚本

时间:2014-05-30 06:37:09

标签: angularjs angularjs-directive angularjs-routing

学习Angular Route Styles后,在不同的模板上应用不同的样式会更容易。

因为它使它如此动态,我想知道是否有一个库可以在特定模板(如Angular Route Styles的路径配置中动态地附加脚本文件,用于样式表?

更像这样(更多关注 js:“app / controller / template.js”

$routeProvider.when("/",
{
  templateUrl: "template.html",
  controller: "TemplateCtrl",
  css: "css/template.css",
  js: "app/controller/template.js"
});

我打算为模板的控制器编写一个外部js文件。因此,当然,删除配置文件上的属性controller: "TemplateCtrl"。但这会使代码管理变得更容易。

0 个答案:

没有答案