2014-09-21 67 views
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> 

回答

0

99.99的我单独所有的CSS%的时间到不同的.css文件根据按钮,导航,排版,特价等..并从不内联或开头

个人而言,我想不出一个很好的理由,以保持它内联或inhead,这也使得在保持一般很难具有.html文件,以寻找对CSS。

相关问题