I need to call a Jquery method inside an angular component, this is the scenario:
I want to use Materialize CSS framework toast feature:
eg:
Materialize.toast('toast content', 3000);
I tried to do like that:
ngAfterViewInit() {
$(this.elementRef.nativeElement.Materialize.toast('toast content', 3000));
}
My console output is:
TypeError: Cannot read property 'toast' of undefined
Materialize. Why do you think the element has aMaterializeproperty?Materialize.toast('toast content', 3000);should do it