Last active
May 29, 2019 19:42
-
-
Save phenomnomnominal/df2e6978595b6f7d8565f74baaec3a43 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, Input } from '@angular/core'; | |
@Component({ | |
// ... | |
}) | |
export class HelloComponent { | |
private _primary: boolean; | |
@Input() get primary (): boolean { | |
return this._primary; | |
} | |
set primary (newValue: boolean) { | |
this._primary = newValue != null && `${newValue}` !== 'false'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment