我正在按照thinkster.io/angular-rails上的教程进行操作
到目前为止,我已经结束了这一阶段
将前端与资产管道集成
但是现在我的应用给我一个空白页,在Chrome控制台或WebRick控制台上都没有错误
这是我尝试转到http://localhost:3000/#/home时看到的内容
Started GET "/" for ::1 at 2015-10-14 18:57:54 -0300
Processing by ApplicationController#angular as HTML
Rendered layouts/application.html.erb within layouts/application (95.2ms)
Completed 200 OK in 177ms (Views: 176.4ms | ActiveRecord: 0.0ms)
Started GET "/assets/bootstrap/dist/css/bootstrap.css.map" for ::1 at 2015-10-14 18:57:59 -0300
如果我尝试转到http://localhost:3000,则可以在WebRick上看到所有这些内容
Started GET "/" for ::1 at 2015-10-14 19:02:09 -0300
Processing by ApplicationController#angular as HTML
Rendered layouts/application.html.erb within layouts/application (55.3ms)
Completed 200 OK in 106ms (Views: 105.9ms | ActiveRecord: 0.0ms)
Started GET "/assets/bootstrap/dist/css/bootstrap-b0009f9e25467a0cf98029ba5cea5cc6.css?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/application-ebcbb47a1897dc658f254d3ed27f8059.css?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/angular/angular-2d5a33d94b093db45bb7a9ede7fb19cd.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/app-aa9fab9c243b33abeab86ad1957ed641.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/angular-ui-router/release/angular-ui-router-baa37ca0378f13b403a5dbcdc9aa5155.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/angular-rails-templates-4c1f2ca110b30578d07f9cc497121e81.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/home/mainCtrl-b29014101de152dbd6e2c9dc5c28ece7.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/posts/posts-35d84f25af005d974cc5973c2ef26354.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/posts/_posts-bc8b8c3f542abacc3b5e9ad028f3cb96.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/posts/postsCtrl-5ef10d79585a7fc3d40aa58e799fbf70.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/application-c0bc5d796fa367b0c956d35d8a01fdb4.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/home/_home-583f0c3e136561b0bb8b62359042f948.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/bootstrap/dist/css/bootstrap.css.map" for ::1 at 2015-10-14 19:02:09 -0300
Started GET "/assets/application-c0bc5d796fa367b0c956d35d8a01fdb4.js?body=1" for ::1 at 2015-10-14 19:02:09 -0300
你可以在这里看到我的源代码
https://bitbucket.org/federicogiust/flapper-news/src
最佳答案
找到了问题。
我仍然在局部_home.html和_posts.html中具有脚本标签。
我删除了脚本标签,现在可以正常使用了。
关于javascript - AngularJS Rails给出空白页,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33136464/