1

I created an AngularJS directive that uses templateUrl to link to an html page which contains a graph. Basically I want to re-render a graph based on the users input. I thought the easiest way would be to make the graph a directive, and set the graphs input on a scope model.

My directive:

app.directive('ngGraph', function(){

return {templateUrl:'graph.html'}

});

Graph.html

<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<h1>hello</h1>


<script>

// the values need to render graph;

</script>

Basically what is happening the <h1>hello</h1> renders in my index.html when I reference the directive but not the graph.

1
  • Try including your <script> tags in your main index.html, not in the directive template. Commented Nov 24, 2014 at 22:41

1 Answer 1

1

I think you have to initialise your graph element in your directive link function

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.