Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 67f8713

Browse files
hangouts updates with Ward
1 parent 3aee02b commit 67f8713

File tree

10 files changed

+26
-85
lines changed

10 files changed

+26
-85
lines changed

public/docs/_examples/reactive-forms/ts/app/app.component.html

Lines changed: 0 additions & 6 deletions
This file was deleted.

public/docs/_examples/reactive-forms/ts/app/app.component.spec.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
// #docplaster
21
// #docregion
3-
// #docregion app-comp-ts
42
import { Component } from '@angular/core';
53

64
@Component({
75
moduleId: module.id,
86
selector: 'my-app',
9-
templateUrl: './app.component.html'
7+
template: `
8+
<div class="container">
9+
<reactive-form></reactive-form>
10+
</div>`
1011
})
1112
export class AppComponent { }
12-
13-
// #enddocregion app-comp-ts
14-
// #enddocregion
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
11
// #docplaster
22
// #docregion
3-
// #docregion app-module
4-
// #docregion reactive-imports
53
import { NgModule } from '@angular/core';
64
import { BrowserModule } from '@angular/platform-browser';
75
import { ReactiveFormsModule } from '@angular/forms'; // <-- #1 import the module
8-
import { AppComponent } from './app.component';
9-
import { ReactiveFormComponent } from './reactive-form.component';
10-
// #enddocregion reactive-imports
6+
import { AppComponent } from './app.component';
7+
import { HeroSignUpComponent } from './hero-signup.component';
118

12-
// #docregion add-reactive-forms-module
139
@NgModule({
1410
imports: [
1511
BrowserModule,
1612
ReactiveFormsModule // <-- #2 add to Angular module imports
1713
],
1814
declarations: [
1915
AppComponent,
20-
// #enddocregion add-reactive-forms-module
21-
ReactiveFormComponent // <-- psst...while you're in here, declare the ReactiveFormComponent
22-
// #docregion add-reactive-forms-module
16+
HeroSignUpComponent // <-- #3 declare the HeroSignUpComponent
2317
],
2418
bootstrap: [ AppComponent ]
2519
})
2620
export class AppModule { }
27-
// #enddocregion add-reactive-forms-module
28-
// #enddocregion app-module
29-
30-
// #docregion

public/docs/_examples/reactive-forms/ts/app/hero-signup-v1.component.ts renamed to public/docs/_examples/reactive-forms/ts/app/hero-signup.component.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { AbstractControl, FormControl, FormGroup, FormBuilder} from '@angular/fo
1414
@Component({
1515
moduleId: module.id,
1616
selector: 'reactive-form',
17-
templateUrl: './reactive-forms.component.html'
17+
templateUrl: './hero-signup.component.1.html'
1818
})
1919
// #enddocregion reactive-comp-metadata-v1
2020

public/docs/_examples/reactive-forms/ts/app/hero-signup.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ function passwordMatcher(c: AbstractControl) {
1515
@Component({
1616
moduleId: module.id,
1717
selector: 'reactive-form',
18-
templateUrl: './reactive-form.component.html'
18+
templateUrl: './hero-signup.component.html'
1919
})
2020
// #enddocregion reactive-comp-metadata
2121
// #docregion form-array-class
22-
export class ReactiveFormComponent {
22+
export class HeroSignUpComponent {
2323

2424
form: FormGroup;
2525
addresses: FormArray;

public/docs/_examples/reactive-forms/ts/app/hero.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11

2-
// #docplaster
3-
// #docregion
4-
// #docregion const
5-
const myControl = new FormControl();
6-
// #enddocregion const
7-
8-
// #docregion inspect
9-
myControl.value
10-
myControl.status
11-
myControl.valid
12-
myControl.pristine
13-
myControl.untouched
14-
// #docregion inspect
2+
import { FormControl } from '@angular/forms';
3+
4+
export class Snippets {
5+
// #docregion const
6+
const myControl = new FormControl();
7+
// #enddocregion const
8+
9+
// #docregion inspect
10+
myControl.value;
11+
myControl.status;
12+
myControl.valid;
13+
myControl.pristine;
14+
myControl.untouched;
15+
// #docregion inspect
16+
}
1517

public/docs/ts/latest/guide/reactive-forms.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ a#update
113113

114114
Update `app.component.ts` by adding `moduleId: module.id` to the `@Component` decorator so you can use a [relative path](./cookbook/component-relative-paths.html) to get to the `templateUrl` which is the `app.component.html` file you just created.
115115

116-
+makeExample('reactive-forms/ts/app/app.component.ts', 'app-comp-ts','app/app.component.ts')(format=".")
116+
+makeExample('reactive-forms/ts/app/app.component.ts', '','app/app.component.ts')(format=".")
117117

118118
:marked
119119
It’s working but to give it some style, add bootstrap by putting this in the head of `index.html`:

0 commit comments

Comments
 (0)