1

http://jsfiddle.net/fresheyeball/5z7bX/

<script type="text/ng-template" id="/newTrack.html">
 <h1>New Track </h1>
 <p>Hello there</p>
</script>
<div id="overlay" closemodal></div>
<div id="modal"><a id="closeModal" closemodal></a>
 <div id="modalContent" ng-include src="/newTrack.html"></div>
</div>

I would expect the following result:

<div id="overlay" closemodal></div>
<div id="modal"><a id="closeModal" closemodal></a>
 <div id="modalContent" ng-include src="/newTrack.html">
 <h1>New Track </h1>
 <p>Hello there</p>
 </div>
</div>

But nothing seems to happen. Really I am trying to render the template from inside a custom directive, after tracking it down for a while, it appears I can't get ng-include to working even in its most simple form. What am I missing here?

asked Apr 16, 2013 at 2:21

1 Answer 1

5

Under Fiddle Options, add <body ng-app>

src: If the source is a string constant, make sure you wrap it in quotes, e.g.,src="'myPartialTemplate.html'". -- ngInclude docs

So ng-include src="'/newTrack.html'"

Fiddle

answered Apr 16, 2013 at 2:35
Sign up to request clarification or add additional context in comments.

2 Comments

its the quotes inside quotes that got me.
I'm sorry I am still struggling with this problem. If you want to help I opened a second question stackoverflow.com/questions/16028594/angular-scope-confusion

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.