* docs(displaying-data/dart): proofread - Dart prose simplified by removing discussion of "additions to pubspec.yaml" which are no longer necessary given the current state of QuickStart. - E2e suites passed: public/docs/_examples/displaying-data/dart public/docs/_examples/displaying-data/ts Contributes to #1598 and #1508. * docs(displaying-data/ts): proofread - TS prose updated to include @kwalrath's revisions from a while ago, with some of my edits as well. - E2e suites passed: public/docs/_examples/displaying-data/dart public/docs/_examples/displaying-data/ts * docs(displaying-data/ts): post-review edits
27 lines
606 B
Dart
27 lines
606 B
Dart
// #docregion
|
|
import 'package:angular2/core.dart';
|
|
|
|
@Component(
|
|
selector: 'my-app',
|
|
// #docregion template
|
|
template: '''
|
|
<h1>{{title}}</h1>
|
|
<h2>My favorite hero is: {{myHero}}</h2>
|
|
<p>Heroes:</p>
|
|
<ul>
|
|
// #docregion li
|
|
<li *ngFor="let hero of heroes">
|
|
{{ hero }}
|
|
</li>
|
|
// #enddocregion li
|
|
</ul>
|
|
'''
|
|
// #enddocregion template
|
|
)
|
|
// #docregion class
|
|
class AppComponent {
|
|
String title = 'Tour of Heroes';
|
|
List<String> heroes = ['Windstorm', 'Bombasto', 'Magneta', 'Tornado'];
|
|
String get myHero => heroes.first;
|
|
}
|