File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 77 TemplateRef ,
88 ViewChild ,
99 ContentChild ,
10- AfterContentInit
10+ AfterContentInit ,
11+ ChangeDetectorRef
1112} from "@angular/core" ;
1213
1314import { TextArea } from "./text-area.directive" ;
@@ -151,7 +152,7 @@ export class Label implements AfterContentInit, AfterViewInit {
151152 /**
152153 * Creates an instance of Label.
153154 */
154- constructor ( ) {
155+ constructor ( protected changeDetectorRef : ChangeDetectorRef ) {
155156 Label . labelCounter ++ ;
156157 }
157158
@@ -175,6 +176,7 @@ export class Label implements AfterContentInit, AfterViewInit {
175176 // avoid overriding ids already set by the user reuse it instead
176177 if ( inputElement . id ) {
177178 this . labelInputID = inputElement . id ;
179+ this . changeDetectorRef . detectChanges ( ) ;
178180 }
179181 inputElement . setAttribute ( "id" , this . labelInputID ) ;
180182 return ;
@@ -184,6 +186,7 @@ export class Label implements AfterContentInit, AfterViewInit {
184186 if ( divElement ) {
185187 if ( divElement . id ) {
186188 this . labelInputID = divElement . id ;
189+ this . changeDetectorRef . detectChanges ( ) ;
187190 }
188191 divElement . setAttribute ( "id" , this . labelInputID ) ;
189192 }
You can’t perform that action at this time.
0 commit comments