* 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
		
			
				
	
	
		
			31 lines
		
	
	
		
			698 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			698 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| // #docregion
 | |
| import 'package:angular2/core.dart';
 | |
| 
 | |
| import 'hero.dart';
 | |
| 
 | |
| @Component(
 | |
|     selector: 'my-app',
 | |
|     template: '''
 | |
|       <h1>{{title}}</h1>
 | |
|       <h2>My favorite hero is: {{myHero.name}}</h2>
 | |
|       <p>Heroes:</p>
 | |
|       <ul>
 | |
|         <li *ngFor="let hero of heroes">
 | |
|           {{ hero.name }}
 | |
|         </li>
 | |
|       </ul>
 | |
|       // #docregion message
 | |
|       <p *ngIf="heroes.length > 3">There are many heroes!</p>
 | |
|       // #enddocregion message
 | |
|     ''')
 | |
| class AppComponent {
 | |
|   String title = 'Tour of Heroes';
 | |
|   List<Hero> heroes = [
 | |
|     new Hero(1, 'Windstorm'),
 | |
|     new Hero(13, 'Bombasto'),
 | |
|     new Hero(15, 'Magneta'),
 | |
|     new Hero(20, 'Tornado')
 | |
|   ];
 | |
|   Hero get myHero => heroes.first;
 | |
| }
 |