Change `ngFor=“#…”` to `ngFor=“let…` in code. All are .dart files except for `app_component.html` which also has changes for: - `<inpuf var-foo…`> to `<input ref-foo…>` - `#docregion` tag name updates from var-foo to ref-foo. - Other misc updates to minimize diffs with TS version of file, whitespace differences were ignored. + Minor update to sync up Dart prose with TS prose. + Used https://github.com/angular/angular/wiki/Angular-2-Dart-Transformer#resol ved_identifiers to solve https://github.com/angular/angular.io/issues/1033 Guide/pipes not updated as it will be rolled back to beta.15 in PR #1220.
		
			
				
	
	
		
			33 lines
		
	
	
		
			648 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			648 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| // #docregion
 | |
| import 'package:angular2/core.dart';
 | |
| 
 | |
| import 'hero.dart';
 | |
| 
 | |
| final List<Hero> _heroes = [
 | |
|   new Hero(1, 'Windstorm'),
 | |
|   new Hero(13, 'Bombasto'),
 | |
|   new Hero(15, 'Magneta'),
 | |
|   new Hero(20, 'Tornado')
 | |
| ];
 | |
| 
 | |
| @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 = _heroes;
 | |
|   Hero myHero = _heroes[0];
 | |
| }
 |