Skip to content

Instantly share code, notes, and snippets.

@vogloblinsky
Last active November 26, 2017 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vogloblinsky/81635336987e7da35764d9fea1a684e4 to your computer and use it in GitHub Desktop.
Save vogloblinsky/81635336987e7da35764d9fea1a684e4 to your computer and use it in GitHub Desktop.
@Component({
selector: 'hello-world',
template: `<h1>
Hello world ! My name is {{name}} !
</h1>
<button (click)="onClick()">Hi !</button>`,
styles: [`
button {
color: #3498db;
}
`],
encapsulation: ViewEncapsulation.Native
})
export class HelloComponent {
@Input() name;
@Output() hi = new EventEmitter<string>();
onClick() {
this.hi.emit(`Hi, ${this.name} talking.`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment