Skip to content

Commit

Permalink
fix: ExpressionChangedAfterItHasBeenCheckedError (#182) (#212)
Browse files Browse the repository at this point in the history
fix: replace ngAfterViewInit by ngAfterContentInit

Signed-off-by: uleoner <ericandre.leon-rodas@montreal.ca>
Signed-off-by: Maude Laflamme <maude.laflamme@montreal.ca>
Co-authored-by: mtlealr <142228898+mtlealr@users.noreply.github.com>
  • Loading branch information
MaudeLaflamme and mtlealr authored Jul 18, 2024
1 parent 1b5b735 commit d63ff6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/angular-ui/src/lib/button/button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* See LICENSE file in the project root for full license information.
*/
import {
AfterViewInit,
AfterContentInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
Expand Down Expand Up @@ -45,7 +45,7 @@ const LOADING_SPINNER_CLASS = 'loading-spinner';
'[class.bao-button-full-width]': 'fullWidth === true'
}
})
export class BaoButtonComponent implements AfterViewInit {
export class BaoButtonComponent implements AfterContentInit {
/**
* The display type of the button
*/
Expand Down Expand Up @@ -94,7 +94,7 @@ export class BaoButtonComponent implements AfterViewInit {
return this.elementRef.nativeElement;
}

public ngAfterViewInit() {
public ngAfterContentInit() {
const childNodes = Array.from(this.nativeElement.childNodes);
const textIndex = childNodes.findIndex(c => c.nodeType === Node.TEXT_NODE);
this.noText = textIndex === -1;
Expand Down

0 comments on commit d63ff6e

Please sign in to comment.