我以這種方式包含了我的組件的.css檔案 `
angular.
module('home')。
component('home', {
模板Url。'home/home.template.html'。
styleUrls: 'home/home.component.css'
` 但似乎樣式表并沒有被應用。 包括樣式表的正確方法是什么? 這是檔案夾結構。
uj5u.com熱心網友回復:
你必須像這樣把方括號放在網址上。styleUrls: ['home/home.component.css']/code>
angular.
module('home').
component('home', {
模板Url。'home/home.template.html'/span>。
styleUrls: ['home/home.component.css'] 。
});
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" class="snippet-box-edit snippet-box-result" frameborder="0"></iframe>
uj5u.com熱心網友回復:
styleUrls接受一個陣列
styleUrls: ['home/home.component.css']/span>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/307484.html
標籤:
