15 lines
376 B
TypeScript

import {Component, View, NgIf} from 'angular2/angular2';
@Component({selector: 'animate-app'})
@View({
directives: [NgIf],
template: `
<h1>The box is {{visible ? 'visible' : 'hidden'}}</h1>
<div class="ng-animate box" *ng-if="visible"></div>
<button (click)="visible = !visible">Animate</button>
`
})
export class AnimateApp {
visible: boolean = false;
}