Created
October 25, 2016 05:40
-
-
Save wKoza/59342d7af0aa7052f4ca68b6c3409b8c 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
import { Component, Input } from '@angular/core'; | |
@Component({ | |
selector: 'name-child', | |
template: ` | |
<h3>"{{name}}"</h3> | |
` | |
}) | |
export class NameChildComponent { | |
_name: string = '<no name set>'; | |
@Input() | |
set name(name: string) { | |
this._name = (name && name.trim()) || '<no name set>'; | |
} | |
get name() { return this._name; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment