1
我试图显示一个使用指令的UI网格页脚的外部作用域。外部范围在表格中正确显示,但当我尝试在链接功能中访问它时,该变量未定义。想法?未定义的外部示波器用户界面
app.directive('testDir',[function(){
return {
restrict: 'E',
replace: true,
transclude: true,
template: '<div>{{t1.val}}</div>',
scope: {
t1: '='
},link: function(scope){
console.log(scope); //=====>t1 is there in the console.
console.log(scope.t1); //=====>t1 is undefined in console.
}
};
}]);
http://plnkr.co/edit/qas0f23oE6RJOuYzrcOm?p=preview