docs(toh-1/dart): minor edits (#1614)
- Fixed HTML. - Removed unnecessary snippet since it is in the code. - Copyedit (Hero Property) -> (Hero property).
This commit is contained in:
parent
f7cf6fde9f
commit
afee8dbe7e
|
@ -25,7 +25,7 @@ template: '''
|
|||
<div><label>id: </label>{{hero.id}}</div>
|
||||
<div>
|
||||
<label>name: </label>
|
||||
<div><input value="{{hero.name}}" placeholder="name"></div>
|
||||
<input value="{{hero.name}}" placeholder="name">
|
||||
</div>'''
|
||||
// #enddocregion editing-Hero
|
||||
|
||||
|
@ -35,7 +35,3 @@ class AppComponent {
|
|||
Hero hero = 'Windstorm';
|
||||
}
|
||||
// #enddocregion app-component-1
|
||||
|
||||
// #docregion hero-property-1
|
||||
Hero hero = new Hero(1, 'Windstorm');
|
||||
// #enddocregion hero-property-1
|
||||
|
|
|
@ -18,11 +18,13 @@ class Hero {
|
|||
<div><label>id: </label>{{hero.id}}</div>
|
||||
<div>
|
||||
<label>name: </label>
|
||||
<div><input [(ngModel)]="hero.name" placeholder="name"></div>
|
||||
<input [(ngModel)]="hero.name" placeholder="name">
|
||||
</div>'''
|
||||
)
|
||||
class AppComponent {
|
||||
String title = 'Tour of Heroes';
|
||||
// #docregion hero-property-1
|
||||
Hero hero = new Hero(1, 'Windstorm');
|
||||
// #enddocregion hero-property-1
|
||||
}
|
||||
// #enddocregion pt1
|
||||
|
|
|
@ -3,7 +3,7 @@ import 'package:angular2/platform/browser.dart';
|
|||
|
||||
import 'package:angular2_tour_of_heroes/app_component.dart';
|
||||
|
||||
main() {
|
||||
void main() {
|
||||
bootstrap(AppComponent);
|
||||
}
|
||||
// #enddocregion pt1
|
||||
|
|
|
@ -87,7 +87,7 @@ code-example(format="" language="bash").
|
|||
Now that we have a `Hero` class, let’s refactor our component’s `hero` property to be of type `Hero`.
|
||||
Then initialize it with an id of `1` and the name, "Windstorm".
|
||||
|
||||
+makeExample('toh-1/dart-snippets/app_component_snippets_pt1.dart', 'hero-property-1', 'app_component.dart (Hero property)')(format=".")
|
||||
+makeExample('toh-1/dart/lib/app_component.dart', 'hero-property-1', 'app_component.dart (hero property)')(format=".")
|
||||
|
||||
:marked
|
||||
Because we changed the hero from a string to an object,
|
||||
|
|
Loading…
Reference in New Issue