組件獲取別的組件暴露的方法 獲取不到方法
app.directive("strength",function(){ return{ require: "^superman", link:function(scope,ele,attrs,supermanCtrl){ supermanCtrl.addStrength(); } } }) 這個(gè)獲取不到父組件的方法 為什么呢? 報(bào)錯(cuò):TypeError: superman.addStrength is not a function
2017-08-04
this = $scope.abilities
2017-02-17
暴露的方法在controller里面要用this.名稱=function(){} 寫(xiě)成$scope.名稱了 不理解啊