【问题标题】:Angular templates grunt not loading角模板咕噜不加载
【发布时间】:2015-07-02 14:13:52
【问题描述】:

我的 AngularJS 项目包含 20 多个 html 模板(路由、模式)。

我正在使用 grunt-angular-templates 将模板拆分到一个文件 templates.js 中。

在我的 Angular 项目中,我使用 angular-route 1.2.25 进行路由。

当我尝试使用 templates.js 文件中的模板时,浏览器崩溃并且没有响应。控制台有任何错误。

问题仅在于带有 Angular 内容的 html 模板(ng-switch、ng-show 等) 当我加载干净的 html 时,它可以工作。

我认为问题在于从 $templateCache 编译模板,但是如何管理它?

Templates.js

...
     $templateCache.put("name","HTML");
...

【问题讨论】:

  • 你能分享更多关于你的项目结构和angular-templates任务的grunt配置的信息

标签: angularjs gruntjs


【解决方案1】:

经过长时间的搜索,我发现了问题所在。

在我的解决方案中,我使用 Modal Boostrap for Angular。 grunt-angular-templates 插件无法正确编译此模板。我只是跳过这些文件,一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 2014-08-04
    • 2015-01-05
    • 1970-01-01
    相关资源
    最近更新 更多