2014-10-03 59 views
0

我創建了繼angularjs PhoneCat教程這裏(http://www.inoneo.com/en/blog/14/grails/angular-phonecat-tutorial-using-a-grails-backend)Grails應用。當我嘗試運行應用程序時,索引頁面空白。我粘貼了index.gsp中內容的下方,我能得到我看到的正在顯示的內容Grails的angularjs phoneCat示例顯示空白頁index.gsp中

<!doctype html> 
<html lang="en"> 
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> 
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> 
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> 
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> 
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]--> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<title>Google Phone Gallery</title> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<r:require module="angular"/> 
<r:layoutResources/> 
</head> 

<body> 
<div class="view-container" ng-app="phonecatApp"> 
<div ng-view class="view-frame"></div> 
</div> 
<r:layoutResources/> 
</body> 

</html> 

=============== 
Source 
<!doctype html> 
<html lang="en"> 
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> 
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> 
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> 
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> 
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]--> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<title>Google Phone Gallery</title> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 

<link href="/dropstore/static/bundle-bundle_angular_head.css"  

type="text/css" rel="stylesheet" media="screen, projection" /> 



</head> 

<body> 
<div class="view-container" ng-app="phonecatApp"> 
<div ng-view class="view-frame"></div> 
</div> 
<script src="/dropstore/static/bundle-bundle_angular_defer.js" type="text/javascript"> 
</script> 
</body> 
</html> 
======== 

,我也越來越是在我的Firefox控制檯 的SyntaxError如下錯誤的來源:失蹤 ;聲明 之前我已經經歷了多次類似主題的搜查,但仍無法找出
問題。任何幫助,高度讚賞。

+0

我仍然有這個問題作鬥爭,請人幫忙。 – Teejay 2014-10-07 19:11:36

回答

0

在這個例子中,靜態資源位於/GrailsAngularPhonecat/下,如:

/GrailsAngularPhonecat/static/bundle-bundle_angular_defer.js"

或者在你的榜樣是:

/dropstore/static/bundle-bundle_angular_defer.js

東西是不對的路徑靜態資源,嘗試再次檢查項目。

這個例子是使用Grails 2.3.7 https://grails.org/download做,你必須運行同一版本啓動它。

爲了更容易嘗試的例子中,我added a WAR這樣你就可以將其部署到應用服務器(比如Tomcat)。

+0

感謝您的回覆,我會嘗試一下,讓它知道它是否有效。 – Teejay 2014-11-07 22:56:03

+0

我改變了我的Grails的版本2.4.4,然後我改變BuildConfig.groovy有需要的最新插件,然後它的作品。 – Teejay 2015-02-08 18:29:51