Created
January 21, 2017 00:19
-
-
Save miguelramos/c8162f003a4b8952c194eb3c9597d920 to your computer and use it in GitHub Desktop.
Ui decorator example
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
/* THE COMPONENT EXAMPLE */ | |
@Component({ | |
moduleId: __filename, | |
selector: 'fs-home-page', | |
templateUrl: './home.template.html', | |
changeDetection: ChangeDetectionStrategy.OnPush, | |
animations: [Animator.bounceIn(1000)], | |
styles: [` | |
:host { | |
display: block; | |
position: relative; | |
} | |
`] | |
}) | |
@UI({ | |
footer: true, | |
navigator: { | |
isVisible: true, | |
isInverse: false, | |
hasScroll: true, | |
hasInfoBar: true, | |
menu: { | |
enable: true | |
}, | |
side: { | |
enable: true | |
}, | |
info: { | |
enable: true | |
} | |
} | |
}) | |
export class HomeContainer extends Container implements AfterViewInit { | |
toggle: boolean = false; | |
constructor( | |
private detectionStrategy: ChangeDetectorRef | |
) { | |
super(); | |
} | |
onSelect() { | |
this.toggle = (this.toggle) === false ? true : false; | |
this.detectionStrategy.markForCheck(); | |
} | |
ngAfterViewInit() { | |
this.toggle = true; | |
this.detectionStrategy.markForCheck(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment