简体   繁体   English

角模板咕gr不加载

[英]Angular templates grunt not loading

I have AngularJS project with more than 20 html templates (routes, modals). 我有20多个html模板(路线,模态)的AngularJS项目。

I'm using grunt-angular-templates to split tempaltes in one file templates.js. 我正在使用grunt-angular-templates在一个文件templates.js中拆分模板。

In my Angular project I'm using angular-route 1.2.25 for routing. 在我的Angular项目中,我使用angular-route 1.2.25进行路由。

When I try to use template from templates.js file, browser crashes and not responding. 当我尝试使用来自templates.js文件的模板时,浏览器崩溃并且没有响应。 There is any error on console. 控制台上有任何错误。

The problem is only with html templates with Angular stuff (ng-switch, ng-show etc.) When I load clean html it works. 问题仅在于带有Angular东西(ng-switch,ng-show等)的html模板。当我加载干净的html时,它可以工作。

I thing the problem is with compile the templates from $templateCache, but how o manage it? 我的问题是从$ templateCache编译模板,但是如何管理呢?

Templates.js Templates.js

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

After long hours of search I found what's wrong. 经过长时间的搜索,我发现了问题所在。

In my solution I'm using Modal Boostrap for Angular. 在我的解决方案中,我正在使用Modal Boostrap for Angular。 grunt-angular-templates plugin don't compile this templates correctly. grunt-angular-templates插件无法正确编译此模板。 I just skip this files and all works. 我只是跳过了这些文件,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM