html - 平均堆栈 : Change body background color on a certain view

标签 html css angularjs mean-stack

我正在使用 MEAN 堆栈。当我在某个 View 上时,我想知道是否可以更改页面上的背景颜色。例如,如果我单击转到联系人 View ,我希望该 View 的背景颜色更改为蓝色。我根据我的一个观点尝试了这个

<section ng-controller="HomeController" style="background-color #97D2D8;">

</section>

但它只改变了其他元素的颜色而不是页面。谢谢

最佳答案

您可以使用ngClassng-style

ng 风格: 在你的 Controller 中声明一个变量

myStyle={background-color:'red'}; //You can change the color according to the active view

那么在你看来

<section ng-controller="HomeController" ng-style="myStyle">
  </section>

关于html - 平均堆栈 : Change body background color on a certain view,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37636335/

相关文章:

python - 用 BeautifulSoup 刮模式?

html - 两个 div 元素应排成一行

javascript - 在滚动页面时为 div 设置动画

angularjs - 如何使指令对父范围的值变化使用react? angularjs

html - 快速 IE7 CSS z-index 问题需要帮助

javascript - 如何在 HTML(CSS) 中绘制一半的字母或文本?

html - 我如何更改 <article> php 元素样式

AngularJs - 在 $locationChangeStart 中确定下一个位置的路线

javascript - 从请求检索后,AngularJS 数据未显示在 View 中

html - 流体子元素 1px 太宽,但只有一个地方