MCPcopy Index your code
hub / github.com/angular/angular / ngDoCheck

Method ngDoCheck

packages/common/src/directives/ng_class.ts:125–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123 detection cycle.
124 */
125 ngDoCheck(): void {
126 // classes from the [class] binding
127 for (const klass of this.initialClasses) {
128 this._updateState(klass, true);
129 }
130
131 // classes from the [ngClass] binding
132 const rawClass = this.rawClass;
133 if (Array.isArray(rawClass) || rawClass instanceof Set) {
134 for (const klass of rawClass) {
135 this._updateState(klass, true);
136 }
137 } else if (rawClass != null) {
138 for (const klass of Object.keys(rawClass)) {
139 this._updateState(klass, Boolean(rawClass[klass]));
140 }
141 }
142
143 this._applyStateDiff();
144 }
145
146 private _updateState(klass: string, nextEnabled: boolean) {
147 const state = this.stateMap.get(klass);

Callers

nothing calls this directly

Calls 4

_updateStateMethod · 0.95
_applyStateDiffMethod · 0.95
isArrayMethod · 0.80
keysMethod · 0.65

Tested by

no test coverage detected