angular-docs-cn/modules/@angular
Tobias Bosch 8d746e3f67 feat(testing): add implicit test module
Every test now has an implicit module. It can be configured via `configureModule` (from @angular/core/testing)
to add providers, directives, pipes, ...

The compiler now has to be configured separately via `configureCompiler` (from @angular/core/testing)
to add providers or define whether to use jit.

BREAKING CHANGE:
- Application providers can no longer inject compiler internals (i.e. everything
  from `@angular/compiler). Inject `Compiler` instead. This reflects the
  changes to `bootstrap` for module support (3f55aa609f).
- Compiler providers can no longer be added via `addProviders` / `withProviders`.
  Use the new method `configureCompiler` instead.
- Platform directives / pipes need to be provided via
  `configureModule` and can no longer be provided via the
  `PLATFORM_PIPES` / `PLATFORM_DIRECTIVES` tokens.
- `setBaseTestProviders()` was renamed into `initTestEnvironment` and 
  now takes a `PlatformRef` and a factory for a
  `Compiler`.
- E.g. for the browser platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
  
  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);   
  ```

  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {browserTestCompiler, browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      browserTestCompiler,
      browserDynamicTestPlatform(),
      BrowserDynamicTestModule);

  ```
- E.g. for the server platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
  
  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);   
  ```

  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {serverTestCompiler, serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      serverTestCompiler,
      serverTestPlatform(),
      ServerTestModule);

  ```

Related to #9726
Closes #9846
2016-07-06 18:04:19 -07:00
..
common bug(datePipe): passing "hh" to the datepipe (#9774) 2016-07-01 15:34:57 -07:00
compiler feat(testing): add implicit test module 2016-07-06 18:04:19 -07:00
compiler-cli fix(compiler): Missing metadata files should result in undefined (#9704) 2016-07-06 14:26:31 -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 bug(datePipe): passing "hh" to the datepipe (#9774) 2016-07-01 15:34:57 -07:00
forms fix(forms): mark control containers as touched when child controls are touched (#9735) 2016-07-01 15:36:04 -07:00
http docs(api): fix links (#9852) 2016-07-06 14:34:27 -07:00
platform-browser feat(testing): add implicit test module 2016-07-06 18:04:19 -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