angular-cn/modules/@angular
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
..
common feat(forms): add modules for forms and deprecatedForms (#9859) 2016-07-07 11:32:51 -07:00
compiler feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
compiler-cli chore(compiler-cli): correct homepage URL in package.json (#9869) 2016-07-07 08:43:53 -07:00
core feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
docs docs: update cheatsheet import lines (#9614) 2016-06-26 07:31:35 -07:00
examples feat(browser): use AppModules for bootstrap in the browser 2016-07-02 20:35:09 -07:00
facade fix(datePipe): short timezone not displayed, closes #9812 (#9816) 2016-07-07 08:47:30 -07:00
forms feat(forms): add modules for forms and deprecatedForms (#9859) 2016-07-07 11:32:51 -07:00
http docs(api): fix links (#9852) 2016-07-06 14:34:27 -07:00
platform-browser feat(forms): add modules for forms and deprecatedForms (#9859) 2016-07-07 11:32:51 -07:00
platform-browser-dynamic feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
platform-server feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
router feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
router-deprecated feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
upgrade feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
README.dart.md repackaging: all the file moves 2016-05-01 20:51:00 -07:00
README.js.md repackaging: all the file moves 2016-05-01 20:51:00 -07:00
license-banner.txt chore(package.json): make the packages installable 2016-05-27 17:21:34 -07:00
package.json repackaging: all the file moves 2016-05-01 20:51:00 -07:00
pubspec.yaml repackaging: all the file moves 2016-05-01 20:51:00 -07:00

README.js.md

Angular2

The sources for this package are in the main Angular2 repo. Please file issues and pull requests against that repo. This is the repository for the upcoming 2.0 version. If you're looking for the current official version of Angular you should go to angular/angular.js

This package contains different sources for different users:

  1. The files located in the root folder can be consumed using CommonJS.
  2. The files under /es6 are es6 compatible files that can be transpiled to es5 using any transpiler. This contains:
    • dev/: a development version that includes runtime type assertions
    • prod/: a production version that does not include runtime type assertions
  3. The files under /ts are the TypeScript source files.

License: Apache MIT 2.0