2015-11-26 31 views
0

我使用ejs views引擎生成快速項目。使用快遞的ui路由器中的templateURL

我想爲我的home視圖設置一個templateURL,但它總是反饋一個404錯誤。

這是我的代碼。

在我的公開/ Java腳本/ angularApp.js

app.config([ 
'$stateProvider', 
'$urlRouterProvider', 
function($stateProvider, $urlRouterProvider){ 

    $stateProvider 
    .state('home',{ 
     url: '/home', 
     templateUrl: 'home.html', 
     controller: 'MainCtrl', 
     resolve:{ 
      postPromise:['posts', function(posts){ 
       return posts.getAll(); 
      }] 
     } 
    }) 

並在意見/ index.ejs

<div class="row container"> 
    <div class="col-md-6 col-md-offset-3"> 
     <ui-view></ui-view> 
    </div> 
</div> 

在視圖/ home.html的

<div class="page-header"> 
    <h1>Flapper News</h1> 
</div> 

請幫我對於這個問題。 非常感謝〜

+0

是請求URL是什麼以及它實際上應該是?也許它應該是'templateUrl:'views/home.html''? – Phil

+0

@Phil我試過之前,但仍然沒有工作 –

+0

好吧,關於我的問題... – Phil

回答