Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExpressionChangedAfterItHasBeenCheckedError #16

Open
TENDesign opened this issue May 1, 2018 · 0 comments
Open

ExpressionChangedAfterItHasBeenCheckedError #16

TENDesign opened this issue May 1, 2018 · 0 comments

Comments

@TENDesign
Copy link

I am getting an ExpressionChangedAfterItHasBeenCheckedError in my component when using the BreadCrumbService store(); I tried running this on several different lifecycle hooks but all threw the same error.

here is the relevant part of the component.

constructor(
    public contactsrv: ContactsService,
    private router: ActivatedRoute,
    private breadcrumb: BreadcrumbsService
) {
    this.router.params.subscribe(
        params => {
            this.mediaListId = +params['ml'];
            this.contactId = +params['id'];
        }
    );
}

ngOnInit() {

    this.breadcrumb.store([
        {
            label: 'Media Lists',
            url: '/app-media-lists',
            params: []
        },
        {
            label: 'Media List' ,
            url: `/app-media-lists/media-list/list/${this.mediaListId}`,
            params: []
        },
        {
            label: 'Contact Profile',
            url: '',
            params: []
        }
    ]);

    this.getContact();
    this.getTimeline();
    this.getNotes();
    this.getFunnel();
    this.getFunnelCodeTable();

}

the breadcrumb itself is called in the app.component.html:

<ng-progress></ng-progress>
<app-navbar *ngIf="ui" (showEvent)="getToggle($event)"></app-navbar>
<app-sidebar *ngIf="ui" class="main" [ngClass]="{show: show}"></app-sidebar>
<breadcrumb *ngIf="ui" [allowBootstrap]="true"></breadcrumb>
<app-pitching-modal></app-pitching-modal>
<router-outlet></router-outlet>

and in the app.component.ts I have:

ngOnInit() {

    this.breadcrumbs.storePrefixed({label: 'Home' , url: '/', params: []});

    if (screen.width >= 768) {
        this.show = true;
        return this.show;
    } else {
        this.show = false;
        return this.show;
    }

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant