简体   繁体   English

AngularJs / Yeoman / Grunt Play Framework空白页

[英]AngularJs/Yeoman/Grunt Play Framework blank page

Today I decided to try out AngularJs with play framework, I've created a folder inside my public folder called AngularJs, in which i have generated an angular app with yeoman. 今天,我决定尝试使用play框架测试AngularJs,我在公用文件夹AngularJs中创建了一个文件夹,在其中,我用yeoman生成了一个angular应用程序。

After generating the sources with grunt build, in the route folder of play, I've put: 用grunt build生成源代码后,在play的route文件夹中,我将:

GET         /                               controllers.Assets.at(path="/public/javascripts/angularJs/src/dist", file="index.html")

Now the problem I am facing is that the index page is well retrieved but Angular doesn't load the templates. 现在我面临的问题是索引页可以很好地检索,但是Angular不会加载模板。

Anyone have a clue? 有人知道吗?

Ok now I get it after fiddling around for a moment, the problem with angularJs and Play framework, is that play must serv all the angularJS resources, so the solution to the problem, is to create routes to the angularJs dist folder in your public play application folder. 好吧,现在我经过一会儿摆弄,angularJs和Play框架的问题在于,播放必须服务所有angularJS资源,因此解决该问题的方法是在您的公共游戏中创建指向angularJs dist文件夹的路由应用程序文件夹。

for an angularJs application created with Yeoman and generated using "grunt build", you must define these routes : 对于使用Yeoman创建并使用“ grunt build”生成的angularJs应用程序,必须定义以下路线:

GET         /scripts/*Asset                               controllers.Assets.at(path="/public/javascripts/angularJs/scripts", Asset)   
GET         /views/*Asset                               controllers.Assets.at(path="/public/javascripts/angularJs/views", Asset)   

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

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