Mainly Dart-side review, following #1654: - Updates to follow style guide - Suites passed: public/docs/_examples/pipes/dart - Suites failed (known issue - #1761): public/docs/_examples/pipes/ts
25 lines
562 B
Dart
25 lines
562 B
Dart
// #docregion
|
|
import 'package:angular2/angular2.dart';
|
|
|
|
@Component(
|
|
selector: 'hero-birthday2',
|
|
// #docregion template
|
|
template: '''
|
|
<p>The hero's birthday is {{ birthday | date:format }}</p>
|
|
<button (click)="toggleFormat()">Toggle Format</button>
|
|
'''
|
|
// #enddocregion template
|
|
)
|
|
// #docregion class
|
|
class HeroBirthday2Component {
|
|
DateTime birthday = new DateTime(1988, 4, 15); // April 15, 1988
|
|
|
|
bool toggle = true;
|
|
|
|
get format => toggle ? 'shortDate' : 'fullDate';
|
|
|
|
void toggleFormat() {
|
|
toggle = !toggle;
|
|
}
|
|
}
|