【发布时间】:2019-03-18 23:53:56
【问题描述】:
现在我有 2 个 css 文件 (ltr.css/rtl.css) 我已在 angular.json 文件中默认导入文件或从 index.html 导入它,它们工作得很好, 但是当在 index.html 中默认加载一个并尝试通过 js 在角度服务中将一个更改为另一个时,href 发生了变化,但样式不像我默认加载它那样需要重新加载页面或刷新
html css 标签
这是我将 css 更改为另一个的代码
initLayoutAlign(){
this.translate.get('LANGALIGN').subscribe((align)=>{
this.document.getElementById('style-bandle').setAttribute('href','assets/demo/default/base/style.bundle'+(align=='rtl'?'.rtl':'')+'.css');
})
}
【问题讨论】:
标签: javascript html css angularjs angular