diff --git a/public/docs/_examples/forms/ts/src/index.html b/public/docs/_examples/forms/ts/src/index.html index 2aa0229ab4..42fa6ee681 100644 --- a/public/docs/_examples/forms/ts/src/index.html +++ b/public/docs/_examples/forms/ts/src/index.html @@ -7,20 +7,18 @@ + - - + + - - -
diff --git a/public/docs/_examples/quickstart/ts/src/app.ts b/public/docs/_examples/quickstart/ts/src/app.ts index e34a9804be..f036ae5e45 100644 --- a/public/docs/_examples/quickstart/ts/src/app.ts +++ b/public/docs/_examples/quickstart/ts/src/app.ts @@ -1,5 +1,5 @@ // #docregion -import {Component, bootstrap} from 'angular2/angular2'; +import {bootstrap, Component} from 'angular2/angular2'; @Component({ selector: 'my-app', diff --git a/public/docs/_examples/quickstart/ts/src/app/app.ts b/public/docs/_examples/quickstart/ts/src/app/app.ts index e34a9804be..f036ae5e45 100644 --- a/public/docs/_examples/quickstart/ts/src/app/app.ts +++ b/public/docs/_examples/quickstart/ts/src/app/app.ts @@ -1,5 +1,5 @@ // #docregion -import {Component, bootstrap} from 'angular2/angular2'; +import {bootstrap, Component} from 'angular2/angular2'; @Component({ selector: 'my-app', diff --git a/public/docs/ts/latest/guide/forms.jade b/public/docs/ts/latest/guide/forms.jade index 6aabb05601..ac62010289 100644 --- a/public/docs/ts/latest/guide/forms.jade +++ b/public/docs/ts/latest/guide/forms.jade @@ -81,9 +81,11 @@ figure.image-display 1. Show and hide validation error messages 1. Handle form submission with **ng-submit** 1. Disable the form’s submit button until the form is valid - -.l-main-section + :markdown + ## Setup + Create a new project folder (`angular2-forms`) and follow the steps in the [QuickStart](../quickstart.html). + ## Create the Hero Model Class As users enter form data, we capture their changes and update an instance of a model. @@ -152,6 +154,27 @@ figure.image-display We made a good choice to put the HTML template elsewhere. Let's write it. +.l-main-section +:markdown + ## Revise the *app.ts* + + `app.ts` is the application's root component. It will host our new `HeroFormComponent`. + + Replace the contents of the "QuickStart" version with the following: ++makeExample('forms/ts/src/app/app.ts') + +:markdown +.l-sub-section + :markdown + There are only three changes: + + 1. We import the new `HeroFormComponent`. + + 1. The `template` is simply the new element tag identified by the component's `select` property. + + 1. The `directives` array tells Angular that our templated depends upon the `HeroFormComponent` + which is itself a Directive (as are all Components). + .l-main-section :markdown ## Create an initial HTML Form Template @@ -186,7 +209,7 @@ figure.image-display npm install bootstrap :markdown