Last active
November 26, 2017 08:25
-
-
Save vogloblinsky/81635336987e7da35764d9fea1a684e4 to your computer and use it in GitHub Desktop.
This file contains 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
@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