2014-09-21 101 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。