javascript - If I write {{data binding}} in the style, will the appearance style be automatically refreshed immediately when the data changes? Should I use style or ng-style?
天蓬老师
天蓬老师 2017-05-17 09:56:53
0
1
691

<p style="background-size: 34px {{data.height}}px;">

If you write data binding in the style, will the appearance style be automatically refreshed immediately when the data ($scope.data.height) changes? Should I use style or ng-style at this time? What's the difference between the two? Does ng-style have the effect of making the appearance style respond immediately to data changes?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
Peter_Zhu
<h1 ng-style='{    "color" : "white",
    "background-color" : "coral",
    "font-size" : "60px",
    "padding" : "50px"
  }'>教程</h1>
  
  用框架就乖乖的按着他提供的东西去用
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template