0
把css放在templateURL指令裏是好的嗎?或者是在文件中更好的分流,把css放在templateURL指令中
例如:
指令文件:
.directive('btn', function() {
return {
templateUrl: 'views/form/btn.html',
restrict: 'E',
scope: {},
controller: function($scope, $attrs) {
}
};
})
模板文件:btn.html
.custom-input-file {
overflow: hidden;
position: relative;
cursor: pointer;
}
.custom-input-file .input-file {
margin: 0;
padding: 0;
outline: 0;
cursor: pointer;
}
<div class="custom-input-file icons ng-binding"><input type="file" size="1" class="input-file" />
upload file
</div>