I am working on angular 2. I have used materialize-css which works fine with classes But problem came with materialize toast
. I Configured materialize with gulpfile.js do i need to add any other js file in gulpfile?
<a class="btn" (click)="Materialize.toast('I am a toast', 4000)">Toast!</a>
Used this console shows errorMaterialize is not defined
This works for me. Wish I knew why - I could not find this documented anywhere.
import { toast } from 'angular2-materialize';
ngOnInit() {
toast("I am the best toast there is!", 4000);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With