在加载角度应用时隐藏外部html

时间:2018-02-16 18:23:02

标签: angular

在我的index.thml我有很多与我的应用程序无关的东西,它只是其他人提供的静态页眉和页脚,很多标记+样式。

所以问题是我可以不显示styles.css加载的直到样式吗?

我在思考一些装载机,但我相信有更好的灵魂。

感谢。

2 个答案:

答案 0 :(得分:1)

我不太确定你想要达到的目标,但你能做的是:

  1. 添加 showLater 类并显示:无内联这些您不希望在以后看到的元素

    <div class="showLater" style="display:none">Content to hide until styles are loaded</div>

  2. 使用!important

    覆盖style.css

    .showLater {display:block!important;}

答案 1 :(得分:1)

一旦你建立prod,你的问题就会得到解决。

ng build --prod

感谢。