Mmoxiaobei2发布于 11 年前
040420
directive:
app .directive('sidebarR',function(){//首页车每次分类 return{ restrict: 'A',//attribute属性 div geolation replace:true, transclude:false, scope:{ "myDataKey":"=" }, template:<div style="float:right;margin-top:40px;“>
{{dial}}
,
link:function(scope, element, attrs){
console.log(element.html());
// console.log(mydata.html())
// var mdFab=element.find('md-button');
// var length=mdFab.length;
//console.log(length)
//mdFab.each(function(){
// $(this).height(Math.floor(window.innerHeight/length));
//});
}
}
})
页面的div如下:
ps:我这边想实现的功能就是固定在右边的导航栏,现在要对md-button的样式高度宽度进行动态设置,但是link里面element拿到的结果是:
<!-- ngRepeat: dial in myDataKey -->
如何处理这个,还有绑定相应的click函数。