2014-11-24 60 views
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,當我引用指令,但沒有圖形。

+0

嘗試,包括在你的主要的index.html你的''