我正在尝试在生产的Rails服务器上测试我的应用,但是我遇到了Angular的问题。
我config.assets.js_compressor = :uglifier
在production.rb中已将其注释掉,以便可以更好地查看代码。
问题是Angular向我的HTML添加了很多静态代码。
我使用router-ui.search
通过State将模板插入到我的application.html.haml上调用的div中。
在.search
div中,Angular添加了此span元素。
<span class="ng-scope">// Angular Rails Template
// source: app/assets/javascripts/angular-app/templates/_search.html.haml
angular.module("templates").run(["$templateCache", function($templateCache) {
$templateCache.put("angular-app/templates/_search.html", "</span>
它还\n
在元素的开头和结尾添加了一个。
像这样,
<ul id="showresults">\n <!-- ngRepeat: movie in movieList -->\n </ul>
Angular确实可以工作,但是我不知道为什么要插入此多余的代码。
经过大量的尝试和失败之后,我终于找到了问题所在。在我Gemfile.lock的,如果我改变sprockets (3.2.0)
对sprockets (2.12.4)
出现问题。出于某种原因,当我做bundle update
链轮时,gem从3.2.0降到2.14.4。所以我必须改回来。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句