How to get/set/remove element attribute in Angular 2 using “the angular way”?

前端 未结 7 1120
我在风中等你
我在风中等你 2021-01-17 15:48

I\'ve been reading some articles about Angular 2 pitfalls and what to avoid, one of those things revolves around not accessing the DOM directly.

I noticed that the

7条回答
  •  甜味超标
    2021-01-17 16:39

    To remove a class, you still can use setElementClass, the isBool should be set to false. See this link for more info https://github.com/angular/angular/blob/9de76ebfa545ad0a786c63f166b2b966b996e64c/modules/%40angular/platform-browser/src/dom/dom_renderer.ts#L237

提交回复
热议问题