Skip to content

Commit 4e76ab5

Browse files
jbogarthydengwattcos
authored andcommitted
docs: refactor template-driven forms doc as a tutorial (angular#36732)
rework content to meet current documentation standards and conventions, structure as tutorial document type PR Close angular#36732
1 parent ad8d1d6 commit 4e76ab5

File tree

8 files changed

+251
-450
lines changed

8 files changed

+251
-450
lines changed

aio/content/examples/forms/src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
33
import { BrowserModule } from '@angular/platform-browser';
44
import { FormsModule } from '@angular/forms';
55

6-
import { AppComponent } from './app.component';
6+
import { AppComponent } from './app.component';
77
import { HeroFormComponent } from './hero-form/hero-form.component';
88

99
@NgModule({

aio/content/examples/forms/src/app/hero-form/hero-form.component.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,4 @@ <h1>Hero Form</h1>
200200
(ngModelChange)="model.name = $event">
201201
TODO: remove this: {{model.name}}
202202
<!-- #enddocregion ngModel-3-->
203-
<hr>
204-
<!-- #docregion ngModelName-2 -->
205-
<input type="text" class="form-control" id="name"
206-
required
207-
[(ngModel)]="model.name" name="name"
208-
#spy>
209-
<br>TODO: remove this: {{spy.className}}
210-
<!-- #enddocregion ngModelName-2 -->
211-
212203
</div>

aio/content/examples/forms/src/app/hero-form/hero-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// #docregion , v1, final
33
import { Component } from '@angular/core';
44

5-
import { Hero } from '../hero';
5+
import { Hero } from '../hero';
66

77
@Component({
88
selector: 'app-hero-form',

aio/content/guide/forms-overview.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,12 @@ Here are the steps performed in the model to view test.
279279

280280
To learn more about reactive forms, see the following guides:
281281

282-
* [Reactive forms](guide/reactive-forms) guide
283-
* [Form validation](guide/form-validation#reactive-form-validation) guide
284-
* [Building dynamic forms](guide/dynamic-form) tutorial
282+
* [Reactive forms](guide/reactive-forms)
283+
* [Form validation](guide/form-validation#reactive-form-validation)
284+
* [Dynamic forms](guide/dynamic-form)
285285

286286
To learn more about template-driven forms, see the following guides:
287287

288-
* [Building a template-driven form](guide/forms#template-driven-forms) tutorial
289-
* [Form validation](guide/form-validation#template-driven-validation) guide
288+
* [Building a template-driven form](guide/forms) tutorial
289+
* [Form validation](guide/form-validation#template-driven-validation)
290+
* `NgForm` directive API reference

aio/content/guide/forms.md

Lines changed: 238 additions & 429 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.

aio/content/navigation.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,6 @@
254254
"title": "Reactive Forms",
255255
"tooltip": "Create a reactive form using FormBuilder, groups, and arrays."
256256
},
257-
{
258-
"url": "guide/forms",
259-
"title": "Template-driven Forms",
260-
"tooltip": "Create a template-driven form using directives and Angular template syntax."
261-
},
262257
{
263258
"url": "guide/form-validation",
264259
"title": "Validate form input",
@@ -749,6 +744,11 @@
749744
"url": "guide/router-tutorial",
750745
"title": "Using Angular Routes in a Single-page Application",
751746
"tooltip": "A tutorial that covers many patterns associated with Angular routing."
747+
},
748+
{
749+
"url": "guide/forms",
750+
"title": "Building a Template-driven Form",
751+
"tooltip": "Create a template-driven form using directives and Angular template syntax."
752752
}
753753
]
754754
},

0 commit comments

Comments
 (0)