angularJs-directive之組件複用

單向數據流設計 父作用域type改變,type值傳給子作用域的childrenType,改變子作用域的視圖。子作用域視圖發生改變, s c o p e . scope. scope.emit(‘changeType’, v);通過$emit告訴type改變值,通過type的變化改變視圖。數據一定是由父流向子的。 上代碼: scopetest.html <!DOCTYPE html> <html l
相關文章
相關標籤/搜索