Created
May 30, 2019 08:22
-
-
Save phenomnomnominal/604e3f38dd534b9710a1d97d36e01389 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'; | |
import { Value, isBool, isNotNull } from '@trademe/ensure'; | |
@Component({ | |
selector: 'hello' | |
// ... | |
}) | |
export class HelloComponent { | |
private _primary: boolean; | |
@Input() | |
public get primary (): boolean { | |
let val = this._primary; | |
val = isNotNull(val, 'primary'); | |
return val; | |
} | |
public set primary (value: boolean) { | |
let val = value; | |
val = isBool(val, 'primary'); | |
this._primary = val; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment