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
Fresheyeball
30.1k21 gold badges106 silver badges168 bronze badges
1 Answer 1
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'"
answered Apr 16, 2013 at 2:35
Mark Rajcok
365k114 gold badges501 silver badges495 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
Fresheyeball
its the quotes inside quotes that got me.
Fresheyeball
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
default