Commit Graph

3874 Commits

Author SHA1 Message Date
Julie Ralph d75502eeee refactor(testing): remove deprecated test setup functions (#10600)
Remove test setup functions which were deprecated in rc5. See the
changelog for rc5 for how to update. In brief, instead of
`setBaseTestProviders`, use `TestBed.initTestEnvironment`.
2016-08-09 10:46:28 -07:00
Victor Berchet b65f66feff feat(i18n): switch to sha1 for message fingerprinting 2016-08-09 09:52:11 -07:00
Victor Berchet dd68ae3ef1 feat(ExtractorMerger): ignore implicit tags in translatable sections 2016-08-09 09:52:11 -07:00
Victor Berchet 1b04d70626 feat(ExtractorMerger): allow nested implicit tags 2016-08-09 09:52:11 -07:00
Matias Niemelä 0b08dd8674 chore(animations): make sure host-prop animation deprecation is correctly emitted
Closes #10581
2016-08-08 23:39:22 -07:00
Jesús Rodríguez b2b47177cd add brandon suggestions 2016-08-09 03:30:25 +02:00
Jesús Rodríguez f08257ff4a docs(cheatsheet): update for rc5 2016-08-09 03:06:01 +02:00
Igor Minar d1f4222c83 docs(cheatsheet): add NgModules docs to the cheatsheet 2016-08-08 17:18:50 -07:00
Igor Minar d21331e902 fix(ngUpgrade): to work with @NgModule
We changed the bootstrap order:
1. create NgZone
2. bootstrap ng1 inside NgZone and upgrade ng1 components to ng2 components.
3. bootstrap ng2 with NgZone

Note: Previous footgun behavior was: bootstrap ng2 first to extract NgZone, so that ng1 bootstrap can happen in NgZone. This meant that if ng2 bootstrap eagerly compiled a component which contained ng1 components, then we did not have complete metadata.
2016-08-08 12:50:08 -07:00
Igor Minar 37f138e83d test(ngUpgrade): convert the upgrade example to use NgModules
The example worked even before this change - verifying that the fallback/legacy mode works as well.
2016-08-08 12:20:22 -07:00
Igor Minar 5dab0bad3c test(NgUpgrade): add support for loading plaground/upgrade example without bundles 2016-08-08 12:20:22 -07:00
Igor Minar 85e70a4cde style(ngUpgrade): small cleanup 2016-08-08 12:20:21 -07:00
Igor Minar 6b564ecda5 feat(ngUpgrade): add support for NgModules
BREAKING CHANGE: UpgradeAdapter.addProvider are now deprecated in favor of passing in an NgModule into the adapter's constructor

Before:

```
let upgradeAdapter = new UpgradeAdapter();
upgradeAdapter.addProviders([myProvidersArray);
```

After:

```
@NgModule({
  providers: myProvidersArray
})
class MyModule {}

let upgradeAdapter = new UpgradeAdapter(MyModule);
```
2016-08-08 12:17:35 -07:00
Miško Hevery d4cceff0ef chore: remove module aware bootstrap API (#10543)
This API was introduced post RC4, but needs to be removed
before RC5 as we have decided against it.
2016-08-08 09:36:09 -07:00
vsavkin 1a41bd1ca4 feature(router): add route.root returning the root of router state 2016-08-08 09:15:59 -07:00
vsavkin 5a99393355 fix(router): route.parent should work for secondary children 2016-08-08 09:15:59 -07:00
vsavkin afcb3c0035 fix(router): support outlets in non-absolute positions 2016-08-08 09:15:59 -07:00
vsavkin d2d36c61f3 fix(router): fix matrix params check to handle 'special' objects 2016-08-08 09:15:59 -07:00
Damien Cassan 0bd97ecda2 feat(http): add options method to Http (#10540)
Add options method to the Http object, which could be useful when using self-describing RESTful APIs.

This closes #10500, closes #7918
2016-08-08 09:15:13 -07:00
Pawel Kozlowski 46bbcefb36 fix(linker): prevent pollution of empty embeddedView context (#10548)
Fixes #10045
2016-08-08 09:11:35 -07:00
Victor Berchet 74b57dfa7d refactor(i18n): remove circular dep 2016-08-05 13:39:54 -07:00
Victor Berchet 8c9c0986e9 refatcor(digestMessage): takes a `i18n.Message` 2016-08-05 13:39:54 -07:00
Victor Berchet 4028fcaa51 refactor(i18n): Drop `html.Message` and create `i18n.Message` right away 2016-08-05 13:39:54 -07:00
Victor Berchet 7a8ef1eae5 feat(i18n): merge translations 2016-08-05 13:39:54 -07:00
Victor Berchet e811a5d97f refactor(i18n): misc updates 2016-08-05 13:39:54 -07:00
Victor Berchet df44e3e425 fix(i18n extractor): array manipulation 2016-08-05 13:39:54 -07:00
Victor Berchet cdb1a237e5 refactor(compiler): html_parser -> ml_parser 2016-08-05 13:39:54 -07:00
Kara fcafdff10b feat(forms): allow both patching and strict setting of values (#10537) 2016-08-05 13:35:17 -07:00
vsavkin c586656d43 fix(router): fix type definition 2016-08-05 13:12:21 -07:00
vsavkin 3a307c2794 fix(router): absolute redirects should work with lazy loading 2016-08-05 13:12:21 -07:00
vsavkin 4f17dbc721 fix(router): add segmentPath to the link DSL 2016-08-05 13:12:21 -07:00
Jason Choi 99989f5d3f chore(facade): remove most facade/async functions 2016-08-05 12:26:28 -07:00
Jason Choi 6baf3baedd chore(playground): clang-format 2016-08-05 12:26:28 -07:00
Miško Hevery 0d1f3c3b07 fix: support trailing slash in basePath (#10533) 2016-08-05 11:11:24 -07:00
Jason Choi 83e2d3d1cb refactor(RegExpWrapper): remove the facade (#10512) 2016-08-05 09:50:49 -07:00
Victor Berchet b4613ab2d2 fix(ExpressionParser): undefined is undefined (was null) 2016-08-05 09:45:13 -07:00
Victor Berchet 0ca05eee45 feat(ExpressionParser): add support for `this` 2016-08-05 09:45:13 -07:00
Victor Berchet 26c9e1dc70 refactor(NgFor spec): code cleanup 2016-08-05 09:45:13 -07:00
Pawel Kozlowski 797cb5ae7b refactor(NgStyleSpec): simplify NgStyle tests (#10519) 2016-08-05 09:28:08 -07:00
Brandon 63b82cd730 feat(router): Allow navigation without updating the URL (#9608) 2016-08-04 11:46:09 -07:00
Patrice Chalin 2b704f0586 fix(linker/compiler): rename const to avoid duplicate declaration (#10457)
Currently in the `linker/compiler.ts` file, the **same identifier** is used in **two declarations**:
```typescript
export type CompilerOptions = { … }
…
export const CompilerOptions = new OpaqueToken('compilerOptions');
```
This breaks the API doc generation. I’m surprised that this was not flagged by the tsc.

The duplicate declaration was introduced in 46b212706b.
2016-08-04 11:31:58 -07:00
Pawel Kozlowski ce5ba80792 refactor(NgTemplateOutlet): simplify implementation (#10492) 2016-08-04 11:28:36 -07:00
Pawel Kozlowski 8b18ef4ba2 feat(NgStyle): add support for the style.unit notation (#10496)
Closes #10326
2016-08-04 11:00:43 -07:00
Marc Laval cd18de7a21 refactor(compiler): use Object.keys instead of Object.getOwnPropertyNames (#10498) 2016-08-04 10:35:41 -07:00
Jason Choi fd19671c07 chore(benchpress): clang-format and lint 2016-08-04 10:08:37 -07:00
Jason Choi 3fcd6fd93f chore(benchpress): make benchpress compile
Also adds compiling benchpress to the build scripts to verify that.
2016-08-04 10:08:37 -07:00
Alex Eagle c8d53d71a3 fix(ngc): gather metadata for OpaqueToken
Fixes #10482
2016-08-04 10:05:25 -07:00
Miško Hevery 790362e243 fix: put all `ngc` files into a single directory (#10486)
Prior to this change `ngc` would place generated files which refer
to components in the node_modules into the node_module. This is an
issue. Now all of the files are forced into a single directory
as specified in `tsconfig.json` by the `genDir` option.

see: https://docs.google.com/document/d/1OgP1RIpZ-lWUc4113J3w13HTDcW-1-0o7TuGz0tGx0g
2016-08-03 21:34:03 -07:00
Victor Savkin 2eda7a5293 fix(router): provideRouter should use provideRoutes (#10488) 2016-08-03 19:35:12 -07:00
Chuck Jazdzewski 9925aa89dc fix(compiler): Report references to non-exported symbols.
Includes fixes to places now reported as errors.

Part of #8310
2016-08-03 15:42:38 -07:00
Patrice Chalin 6195a45ae2 fix(forms): export AbstractFormGroupDirective
Because
- `Form` is **exported** -- see line 30/31 of
`modules/@angular/forms/src/forms.ts`: i.e., <br>`export {Form} from
'./directives/form_interface'`; and
- Methods of `Form`, which are public, have an
`AbstractFormGroupDirective` parameter;
e.g.,<br>`Form.getFormGroup(dir: AbstractFormGroupDirective):
FormGroup`.

Then it makes sense for `AbstractFormGroupDirective` to be
public/exported too. In any case, if it isn't exported then the **API
docs for `Form` don't get generated properly.**
2016-08-03 15:33:29 -07:00
vsavkin 422d380b3e feat(router): add queryParams and fragment to every activated route 2016-08-03 15:30:03 -07:00
vsavkin 550ab31bd0 feat(router): add parent, children, firstChild to ActivatedRoute 2016-08-03 15:30:03 -07:00
vsavkin 5fceb21549 refactor(router): remove dead code 2016-08-03 15:30:03 -07:00
vsavkin 29caa37943 feat(router): support sibling modules providing routes 2016-08-02 13:31:15 -07:00
Tobias Bosch 8efbcc996a fix(compiler): allow to use pipes inside of `*ngIf` (#10452)
Fixes #9746
2016-08-02 12:19:34 -07:00
Misko Hevery 91c64d2b8d fix: missing export for validators 2016-08-02 12:12:15 -07:00
Chuck Jazdzewski 82e7ecd611 fix(compiler): StaticReflect now resolves re-exported symbols (#10453)
Fixes: #10451
2016-08-02 11:45:14 -07:00
Tobias Bosch 3d53b33391 chore: update public api and integrate minor review comments 2016-08-02 11:23:26 -07:00
Tobias Bosch 34624b2db2 refactor(core): deprecate old methods on `ApplicationRef`
BREAKING CHANGE:
- `ApplicationRef.run` is deprecated. Use `NgZone.run` directly
- `ApplicationRef.injector` is deprecated. Inject an `Injector` or
  use `NgModuleRef.injector` instead
- `ApplicationRef.zone` is deprecated. Inject `NgZone` instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch 1ab5eb0844 refactor(core): don’t use `zone.run` in `ApplicationRef.bootstrap`.
`ApplicationRef.bootstrap` is supposed to be run inside of `ngDoBootstrap` method
of the module that is bootstrapped, and that method already runs inside of the
zone.
2016-08-02 11:23:26 -07:00
Tobias Bosch 630028350a refactor(core): Introduce `AppInitStatus`
This class allows any provider to know and wait for the initialization of the
application. This functionality previously was tied to `ApplicationRef`.

BREAKING CHANGE:
- `ApplicationRef.waitForAsyncInitializers` is deprecated. Use 
  `AppInitStatus.donePromise` / `AppInitStatus.done` instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch 7e4fd7d7da refactor(core): introduce `@NgModule.bootstrap` and `ngDoBootstrap` method
If a `@NgModule` has a `bootstrap` property, `PlatformRef.bootstrapModule` /
`PlatformRef.bootstrapModuleFactory` will automatically bootstrap the components
listed in there.
If such a property does not exist, `PlatformRef.bootstrapModule` /
`PlatformRef.bootstrapModuleFactory` will try to call the method `ngDoBootstrap(appRef: ApplicationRef)` on the module class.
Otherwise an error is reported.
2016-08-02 11:23:26 -07:00
Tobias Bosch af2e80e068 refactor(core): introduce `APP_BOOTSTRAP_LISTENER` multi provider
Using the `registerBootstrapListener` easily lead to race condition
and needed dependencies on `ApplicationRef`.

BREAKING CHANGE:
- `ApplicationRef.registerBootstrapListener` is deprecated. Provide a multi
  provider for the new token `APP_BOOTSTRAP_LISTENER` instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch 8e6091de6c refactor(core): use `ngOnDestroy` in providers
Note about the addition of `beforeEach(fakeAsync(inject(…))))` in some tests:
`ApplicationRef` is now using `ngOnDestroy` and there is eager,
including all of its dependencies which contain `NgZone`.
The additional `fakeAsync` in `beforeEach` ensures that `NgZone`
uses the fake async zone as parent, and not the root zone.

BREAKING CHANGE (via deprecations):
- `ApplicationRef.dispose` is deprecated. Destroy the module that was
   created during bootstrap instead by calling `NgModuleRef.destroy`.
- `AplicationRef.registerDisposeListener` is deprecated.
   Use the `ngOnDestroy` lifecycle hook for providers or
   `NgModuleRef.onDestroy` instead.
- `disposePlatform` is deprecated. Use `destroyPlatform` instead.
- `PlatformRef.dipose()` is deprecated. Use `PlatformRef.destroy()`
   instead.
- `PlatformRef.registerDisposeListener` is deprecated. Use
  `PlatformRef.onDestroy` instead.
- `PlaformRef.diposed` is deprecated. Use `PlatformRef.destroyed`
  instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch ecdaded25f feat(core): introduce `NgModuleRef.destroy` and call `ngOnDestroy` on all providers 2016-08-02 11:23:26 -07:00
Tobias Bosch c161ed415d feat(core): support `ngOnDestroy` on providers of a directive.
Such providers also become eager as they will be instantiated
anyways on destruction.
2016-08-02 11:23:26 -07:00
Tobias Bosch ff3b71f7b3 refactor(core): collect lifecycle hooks for all injectable classes 2016-08-02 11:23:26 -07:00
Tobias Bosch 16cc9b46aa fix(fake_async): share zone between `beforeEach` and `it`
This is needed for the case if a `beforeEach` instantiates
`NgZone`and the `it` uses
`TestComponentBuilder.createFakeAsync`.

Otherwise the `NgZone` will use the root zone as parent,
and `TestComponentBuilder.createFakeAsync` will always return
undefined as `tick` does not forward promises created
under the zone of `NgZone`.
2016-08-02 11:23:26 -07:00
Michael 3ce11ed58c docs(pipes): update I18nSelectPipe API documentation (#10449) 2016-08-02 10:59:07 -07:00
Marc Laval 7db75fa361 test: reactivate some of the disabled tests in Edge (#10450) 2016-08-02 10:58:03 -07:00
Kara d6d4568830 fix(forms): allow arrays as parents (#10440)
Closes #10432
2016-08-02 09:40:42 -07:00
Misko Hevery a55d796c4b fix: Better error message in case of unknown property binding 2016-08-02 09:28:04 -07:00
Misko Hevery 73f02c7861 fix: throw useful error on missing platform module. 2016-08-02 09:28:04 -07:00
Misko Hevery 8c8754e573 chore: add browserNoRouter test running mode 2016-08-02 09:28:04 -07:00
Sam Herrmann c977a906b3 docs(cheatsheet): add moduleId (#10095) 2016-08-02 07:34:04 -07:00
Kara e0eea6c2f4 feat(forms): add invalid prop to abstract controls (#10439) 2016-08-01 18:41:25 -07:00
vsavkin 3e377f520e fix(router): make an outlet to unregister itself when it is removed from the dom 2016-08-01 16:56:38 -07:00
vsavkin 8dc82a0080 fix(router): fix offline compilation by exporting provideLocationStrategy 2016-08-01 16:23:28 -07:00
vsavkin 4624a35845 docs(router): fixes api docs 2016-08-01 16:23:28 -07:00
Kara 8d4499959a feat(forms): add get method for easy access to child controls (#10428) 2016-08-01 14:22:50 -07:00
Victor Berchet 2dfc9c653b refactor: dart 2016-08-01 11:34:51 -07:00
Victor Berchet 106db0aba8 refactor: IS_DART === false 2016-08-01 11:34:51 -07:00
Victor Berchet 28c4852cd6 refactor: remove ts2dart annotations 2016-08-01 11:34:51 -07:00
Victor Berchet 13c8211065 fix: String.split(str, n) stops after n separator (#10408) 2016-08-01 11:33:35 -07:00
Victor Berchet e73d0511cf fix(TemplateParser): report empty expression (#10391)
fixes #3754
2016-08-01 11:24:49 -07:00
Matias Niemelä e18626b7a2 fix(core): ensure ngFor only inserts/moves/removes elements when necessary (#10287)
Closes #9960
Closes #7239
Closes #9672
Closes #9454
Closes #10287
2016-08-01 11:09:52 -07:00
Hans 4df7b1cfbc chore: fixes some issues that happen with closure compiler. (#10392) 2016-08-01 09:47:49 -07:00
Tobias Bosch 93ade740e2 fix(router): configure DI correctly when using the old `provideRouter` function 2016-08-01 02:35:41 -07:00
Tobias Bosch a46437c57d refactor(core): fix `bootstrapModule` regarding zones and initializers (#10383)
This makes `bootstrapModuleFactory` wait for promises
returned by `APP_INITIALIZER`s, also making `bootstrapModuleFactory` async.
I.e. now `bootstrapModule` and `bootstrapModuleFactory` behave in the
same way.

This ensures that all code from module instantiation, to creating
`ApplicationRef`s as well as calling `APP_INITIALIZERS` is run
in the Angular zone.

This also moves the invocation of the initializers from the `ApplicationRef`
constructor into the `bootstrapModuleFactory` call, allowing initializers
to get a hold of `ApplicationRef` (see #9101).

Fixes #9101
Fixes #10363
Fixes #10205
2016-08-01 02:12:59 -07:00
Tobias Bosch 633c7d1ebe refactor(core): cleanup unused `NgZone` factory
This factory was only used when using `coreBootstrap` / `coreLoadAndBoostrap`
which is not supported any more.
2016-08-01 02:12:59 -07:00
Cody-Nicholson 251953218c fix(http): URLSearchParams.clone propagate the QueryEncoder (#9900) 2016-07-30 19:01:20 -07:00
Suguru Inatomi 0d6cc17252 fix(UrlParser): stop setting default value 'true' (#10399) 2016-07-30 14:34:03 -07:00
Zhicheng Wang 6134320f16 refactor(http): rewrite for readable & efficient. 2016-07-29 21:30:28 -07:00
Zhicheng Wang 7f647822bd fix(http): headers should be case-insensitive.
fixes #9452

spec at https://tools.ietf.org/html/rfc2616
2016-07-29 21:30:15 -07:00
Victor Berchet e34a04d2ad feat(xmb/xtb): support dtd 2016-07-29 14:18:34 -07:00
Victor Berchet 44093905e2 refactor(test): refine types 2016-07-29 13:53:13 -07:00
Victor Berchet 3e2900f74b refactor(i18n): move code around 2016-07-29 13:40:58 -07:00
Victor Berchet 11fd2eccec refactor: fix merge glitches 2016-07-29 13:40:58 -07:00
Victor Berchet 0eee1d5de3 feat(i18n): xtb serializer 2016-07-29 13:40:58 -07:00