【发布时间】:2017-07-23 15:58:39
【问题描述】:
如何使组件的 $scope 在该组件的嵌入区域内可访问?这里是一个例子:
<test>
{{myVar}}
</test>
.component('test', {
transclude:true,
template:'<ng-transclude></ng-transclude>',
controller:function($scope){
this.$onInit = function() {
$scope.myVar = 1123
}
}
})
【问题讨论】:
标签: angularjs components