Skip to content

Instantly share code, notes, and snippets.

Created June 6, 2018 04:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import { Component, OnInit, ViewEncapsulation, Input, HostListener, EventEmitter, Output } from "@angular/core";
selector: "custom-message",
template: `
<p [class]="type">
styles: [
`p{display:block; padding:20px;background:#000; color:#fff; font-size:20px; font-family:inherit;}`,
`.success{background:rgb(65, 234, 212);}`,
`.failure{background:rgb(255, 32, 110);}`
encapsulation: ViewEncapsulation.Native
export class MessageComponent implements OnInit {
@Input() message: string = "test";
@Input() type: string = "";
@Output("action") action = new EventEmitter();
onclick() {
constructor() {}
ngOnInit() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment