Skip to content

Instantly share code, notes, and snippets.

@miguelramos
Created January 21, 2017 00:19
Show Gist options
  • Save miguelramos/c8162f003a4b8952c194eb3c9597d920 to your computer and use it in GitHub Desktop.
Save miguelramos/c8162f003a4b8952c194eb3c9597d920 to your computer and use it in GitHub Desktop.
Ui decorator example
/* 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