Created
September 28, 2019 08:40
-
-
Save dujo-stack/4b5f718f919dfa847b8ac56217c2aaaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, EventEmitter, Output } from '@angular/core'; | |
import { DataService } from 'src/app/services/data.service'; | |
import * as M from 'materialize-css'; | |
@Component({ | |
selector: 'app-message', | |
templateUrl: './message.component.html', | |
styleUrls: ['./message.component.css'] | |
}) | |
export class MessageComponent implements OnInit { | |
message: String =''; | |
constructor(private data: DataService) { } | |
ngOnInit() { | |
this.data.currentMessage.subscribe(message => this.message = message); | |
if(this.message.length){ | |
M.toast({html: this.message, classes: 'rounded'}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment