angular-docs-cn/tools
Kara 9d265b6f61 feat(forms): add modules for forms and deprecatedForms (#9859)
Closes #9732

BREAKING CHANGE:

We have removed the deprecated form directives from the built-in platform directive list, so apps are not required to package forms with their app. This also makes forms friendly to offline compilation.

Instead, we have exposed three modules:

OLD API:
- `DeprecatedFormsModule`

NEW API:
- `FormsModule`
- `ReactiveFormsModule`

If you provide one of these modules, the default forms directives and providers from that module will be available to you app-wide.  Note: You can provide both the `FormsModule` and the `ReactiveFormsModule` together if you like, but they are fully-functional separately.

**Before:**
```ts
import {disableDeprecatedForms, provideForms} from @angular/forms;

bootstrap(App, [
   disableDeprecatedForms(),
   provideForms()
]);
```

**After:**

```ts
import {DeprecatedFormsModule} from @angular/common;

bootstrap(App, {modules: [DeprecatedFormsModule] });
```

-OR-

```ts
import {FormsModule} from @angular/forms;

bootstrap(App, {modules: [FormsModule] });
```

-OR-

```ts
import {ReactiveFormsModule} from @angular/forms;

bootstrap(App, {modules: [ReactiveFormsModule] });
```

You can also choose not to provide any forms module and run your app without forms.

Or you can choose not to provide any forms module *and* provide form directives at will.  This will allow you to use the deprecatedForms API for some components and not others.

```
import {FORM_DIRECTIVES, FORM_PROVIDERS} from @angular/forms;

@Component({
   selector: some-comp,
   directives: [FORM_DIRECTIVES],
   providers: [FORM_PROVIDERS]
})
class SomeComp
```
2016-07-07 11:32:51 -07:00
..
@angular/tsc-wrapped fix(ngc): work with typescript@next 2016-06-24 10:27:31 -07:00
analytics chore(): remove all angular2_material code. 2016-03-16 13:37:37 -07:00
broccoli cleanup(router): removes router 2016-06-20 08:47:54 -07:00
build chore(ngc): refactor out tsc-wrapped 2016-05-25 09:45:55 -07:00
cjs-jasmine feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
code.angularjs.org chore(publish): add Rx bundles to code.angularjs.org publish step 2015-12-15 17:12:42 +00:00
karma fix(test-runner): make karma internal reporter compatible with 0.13.20 (#8977) 2016-06-03 10:48:55 -07:00
npm build(npm): short-circuit npm install if node_modules are healthy 2016-05-13 22:07:41 +02:00
public_api_guard feat(forms): add modules for forms and deprecatedForms (#9859) 2016-07-07 11:32:51 -07:00
travis build(travis): add travis log folding for verbose tasks 2015-10-03 21:33:57 +00:00
tree-shaking-test test: add tree-shaking test 2016-06-08 12:20:42 -07:00
tsc-watch feat(core): introduce `@AppModule` 2016-06-30 11:34:40 -07:00
tslint chore(lint): Add lint check for license headers 2016-06-23 09:46:32 -07:00
typings-test fix(typings): don't test compiler-cli typings on TS 1.8 2016-06-23 10:57:03 -07:00
check-environment.js chore(lint): re-enable clang-format on tools/ 2016-05-26 15:46:03 -07:00
chromedriverpatch.js chore(testing): update protractor to version 2.1.0 2015-05-20 17:28:23 -07:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
tsconfig.json test: upgrade ts-api-guardian to v0.1.2 2016-06-23 14:26:40 -07:00
types.d.ts build: remove dependency on tsd and use @types/* instead 2016-05-25 16:42:28 -07:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00