添加style 样式
.
directive(
'autoHeight'
, [
'$window'
,
function (
$window) {
return {
restrict : 'A' , //属性
link : function ( $scope , element) {
$scope. winowHeight = window. screen. height ; //获取窗口高度
element. css( 'height' , $scope. winowHeight + 'px') ;
element. css( 'margin-top' , ( $scope. winowHeight * 0.3) + 'px')
}
} ;
}]) ;
return {
restrict : 'A' , //属性
link : function ( $scope , element) {
$scope. winowHeight = window. screen. height ; //获取窗口高度
element. css( 'height' , $scope. winowHeight + 'px') ;
element. css( 'margin-top' , ( $scope. winowHeight * 0.3) + 'px')
}
} ;
}]) ;