2016-11-04 7 views
0

私はテンプレートを使用しようとしていますが、動作していません。私が間違っていることはありますか?angularjs:ng-includeは別のビューでは動作しません

ビュー構造:

https://i.stack.imgur.com/yFeYs.png

UserList.html:

<p> 
    UserList 
</p> 
<div ng-include src="'../Partials/Paging.html'"></div> 

更新:

Paging : localhost/Administrator/App/Views/User/UserList.html 
UserList : localhost/Administrator/App/Views/Partials/Paging.html 
Index : localhost/Administrator/Index.html 
+0

あなたのindex.htmlはどこですか? 'src =" Partials/Paging.html "' – murli2308

+0

ページング:http://localhost/Administrator/App/Views/Partials/Paging.html ----とindex:http:// localhost/Administrator/Indexを試してください。 html – mywindowshosting2016

+0

私の答えで与えられたパスが正しいかどうかを試してください – Nitheesh

答えて

0

をお試しください0
<div ng-include="'App/Views/Partials/Paging.html'"></div> 

ng-includeはsrcパラメータを必要としません。それでもエラーが表示された場合は、SRCパスを取得することはありませんならばあなたは、パスがあなたのindex.htmlに始まり含ま間違っ

+0

は働いていません...このコード: '

'はなぜIndex.htmlで働いたのですか? – mywindowshosting2016

+0

上記の私の答えを参照してください。あなたのindex.htmlから相対パスが含まれています。 – dbarthel

+0

あなたは現在Administratorフォルダ内にいます。現在の場所からApp/Views/Partials/Paging.htmlに移動する必要があります。したがって、このURLパスは必須です – Nitheesh

0

へのパスを確認してくださいSPAの実行中にそこからロードされているためです。 あなたのインクルードパスはindex.htmlからの相対パスでなければなりません:

<div ng-include="'App/Views/Partials/Paging.html'"></div> 
0

かもしれないまでこの

<div ng-include="'../Partials/Paging.html'"></div> 

を試してみてくださいPaging.html

関連する問題