0

I am trying to include a template and its not working.I have had trouble with includes every single time I try to use them. Is there something I am doing wrong?

views structure :

https://i.sstatic.net/yFeYs.png

UserList.html :

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

update :

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

3 Answers 3

1

Your include path starts on your index.html, since its loaded from there while running your SPA. So your include path has to be relative to your index.html:

<div ng-include="'App/Views/Partials/Paging.html'"></div>
Sign up to request clarification or add additional context in comments.

Comments

0

Try this

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

till if you will not get the src path might be wrong

Comments

0

Try

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

ng-include doesn't requires src parameter. If you still see any error please verify the path to Paging.html

3 Comments

not worked... this code : ` <div ng-include="'App/Views/Partials/Paging.html'"></div> ` worked in Index.html why ?
see my answer above. Include pathes are resolved relative from your index.html
You are currently inside the Administrator folder. You need to move into App/Views/Partials/Paging.html from the current location. So this url path is the required one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.