1
我创建了一个AngularJS指令,该指令使用templateUrl链接到包含图形的html页面。基本上我想根据用户输入重新绘制图形。我认为最简单的方法是将图形制作为指令,并在示波器模型上设置图形输入。AngularJS指令不会在templateUrl页面上呈现javascript
我的指令:
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>
基本上发生了什么<h1>hello</h1>
呈现在我的index.html,当我引用指令,但没有图形。
尝试,包括在你的主要的index.html你的''