Commit Graph

395 Commits

Author SHA1 Message Date
Victor Berchet 78e8814103 feat(router): add `RouteConfigLoadStart` and `RouteConfigLoadEnd` events 2017-02-20 16:19:05 -08:00
Dzmitry Shylovich 7df6f46c1c feat(router): introduce RouteConfigLoaded event
Closes #14036
2017-02-20 16:19:05 -08:00
Victor Berchet 601fd3e305 fix(platform-webworker): integrate review feedback
closes #14581
2017-02-20 16:17:58 -08:00
Victor Berchet cdf99cf68b refactor(platform-webworker): cleanup 2017-02-20 16:17:43 -08:00
Victor Berchet 3517f28609 feat(platform-webworker): renderer v2 integration 2017-02-20 16:17:43 -08:00
Tobias Bosch 778ded9fcf refactor: rename `ComponentRenderTypeV2` to `RendererTypeV2` 2017-02-17 17:18:55 -08:00
Tobias Bosch 0fa3895d5b feat(compiler): implement style encapsulation for new view engine (#14518)
Included refactoring:
- splits the `RendererV2` into a `RendererFactoryV2` and a `RendererV2`
- makes the `DebugRendererV2` a private class in `@angular/core`
- remove `setBindingDebugInfo` from `RendererV2`, but rename `RendererV2.setText` to 
  `RendererV2.setValue` and allow it on comments and text nodes.

Part of #14013
2017-02-16 13:55:55 -08:00
Chuck Jazdzewski 724ca373e7 build: produce metadata bundles for @angular modules (#14509)
Closes #14509
2017-02-16 08:15:30 -08:00
Alex Rickabaugh 56f232cdd7 fix(platform-server): read initial location from INITIAL_CONFIG if present 2017-02-15 09:14:59 -08:00
Victor Berchet bb9c7ae6e7 feat: RendererV2 integration (#14469) 2017-02-14 21:03:18 -08:00
vikerman b4d444a0a7 feat(platform-server): add API to render Module and ModuleFactory to string (#14381)
- PlatformState provides an interface to serialize the current Platform State as a string or Document.

- renderModule and renderModuleFactory are convenience methods to wait for Angular Application to stabilize and then render the state to a string.

- refactor code to remove defaultDoc from DomAdapter and inject DOCUMENT where it's needed.
2017-02-14 16:14:40 -08:00
Alex Eagle 03e855ae8f build: allow users to specify --strictNullChecks (#14382)
PR Close #14382
2017-02-10 14:10:03 -06:00
Matias Niemelä 96073e51c3 refactor(animations): introduce @angular/animation module (#14351)
PR Close: #14351
2017-02-10 14:10:03 -06:00
Chuck Jazdzewski 4da7925ad5 feat(common): added typed overloaded for `AsyncPipe.transform()` (#14367)
BREAKING CHANGE: Classes that derive from `AsyncPipe` and override
`transform()` might not compile correctly. Use of  `async` pipe in
templates is unaffected.

Mitigation: Update derived classes of `AsyncPipe` that override
`transform()` to include the type parameter overloads.

Related to #12398

PR Close #14367
2017-02-09 14:32:39 -08:00
FrozenPandaz 45cc444154 fix(core): Remove ChangeDetectorRef Paramter from KeyValueDifferFactory and IterableDifferFactory (#14311)
BREAKING CHANGE:

- `KeyValueDifferFactory` and `IterableDifferFactory` no longer have `ChangeDetectorRef` as 
  a parameter. It was not used and has been there for historical reasons. If you call 
  `DifferFactory.create(...)` remove the `ChangeDetectorRef` argument.
2017-02-09 13:33:44 -08:00
Vikram Subramanian c4817988ca feat(core): add isStable Observable property to ApplicationRef to indicate when it's stable and unstable (#14337)
PR Close #14337
2017-02-09 12:07:33 -06:00
Alex Eagle 7a4c25535d build: update public API with readonly (#13294)
PR Close #13294
2017-02-08 11:32:47 -06:00
Tobias Bosch 14d7844b2b feat(core): view engine - integrate with `ComponentFactory` (#14237)
`ComponentFactory`s can now be created from a `ViewDefinitionFactory` via
`RefFactory.createComponentFactory`.

This commit also:
- splits `Services` into `Refs` and `RootData`
- changes `ViewState` into a bitmask
- implements `ViewContainerRef.move`

Part of #14013

PR Close #14237
2017-02-03 15:07:12 -06:00
Miško Hevery 69a4bb0bcd doc: standardize deprecation of `preserveQueryParams` (4.0 only) (#14236)
PR closes #14236
2017-02-01 16:48:19 -08:00
Chuck Jazdzewski 86b2b2504f feat(common): rename underlying `NgFor` class and add a type parameter (#14104)
Note, this affects the underlying class and should not affect usage.

DEPRECATION:
- the `NgFor` class is now deprecated. Use `NgForOf<T>` instead.
  IMPORTANT: Only the `NgFor` class is deprecated, not the `ngFor`
  directive. The `*ngFor` and related directives are unaffected by
  this change  as references to the `NgFor` class generated from
  templates will be automatically converted to references to
  `NgForOf<T>` without requiring any template modifications.
- `TrackByFn` is now deprecated. Use `TrackByFunction<T>` instead.

Migration:
- Replace direct references to the `NgFor` class to `NgForOf<any>`.
- Replace references to `TrackByFn` to `TrackByFunction<any>`.

BREAKING CHANGE:
A definition of `Iterable<T>` is now required to correctly compile
Angular applications. Support for `Iterable<T>` is not required at
runtime but a type definition `Iterable<T>` must be available.

`NgFor`, and now `NgForOf<T>`, already supports `Iterable<T>` at
runtime. With this change the type definition is updated to reflect
this support.

Migration:
- add "es2015.iterable.ts" to your tsconfig.json "libs" fields.

Part of #12398

PR Close #14104
2017-02-01 09:29:51 -06:00
Georgios Kalpakas 7670cc1a86 feat(upgrade): export VERSION from `upgrade/static` (#14037)
PR Close #14037
2017-02-01 09:29:51 -06:00
Georgios Kalpakas ea63676970 refactor(upgrade): use shared code in `downgradeNg2Component()` (#14037)
This unified the implementations of dynamic's `downgradeNg2Component()` and
static's `downgradeComponent()`.
2017-02-01 09:29:51 -06:00
Georgios Kalpakas 1f90f29369 feat(upgrade): return a function (instead of array) from `downgradeInjectable()` (#14037)
This makes it more consistent with the dynamic version of `upgrade` and makes it
possible to share code between the dynamic and static versions.

This commit also refactors the file layout, moving common and dynamic-specific
files to `common/` and `dynamic/` directories respectively and renaming `aot/`
to `static/`.

Some private keys, used as AngularJS DI tokens, have also been renamed, but this
should  not affect apps, since these keys are undocumented and not supposed to
be used externally.

BREAKING CHANGE:

Previously, `upgrade/static/downgradeInjectable` returned an array of the form:

```js
['dep1', 'dep2', ..., function factory(dep1, dep2, ...) { ... }]
```

Now it returns a function with an `$inject` property:

```js
factory.$inject = ['dep1', 'dep2', ...];
function factory(dep1, dep2, ...) { ... }
```

It shouldn't affect the behavior of apps, since both forms are equally suitable
to be used for registering AngularJS injectable services, but it is possible
that type-checking might fail or that current code breaks if it relies on the
returned value being an array.
2017-02-01 09:29:51 -06:00
evan Liu c87c3bec93 feat(router): deprecate preserveQueryParams,add queryParamsHandling (#14095)
PR Close #14095
2017-01-31 15:43:25 -06:00
Dzmitry Shylovich fe441186e7 fix(common): add PopStateEvent interface (#13400)
Closes #13378

PR Close #13400
2017-01-31 12:08:54 -06:00
Dzmitry Shylovich f89d004c51 fix(forms): provide a method to compare options (#13349)
Closes #13268

PR Close #13349
2017-01-31 11:38:30 -06:00
Toxicable 7b7ae5fe56 feat(forms): add equalsTo validator (#14052)
PR Close: #14052
2017-01-29 12:22:24 -06:00
WilliamKoza 94b62c963d fix(common) add interface PipeTransform to Async pipe (#14049)
PR Close #14049
2017-01-29 12:18:55 -06:00
执衡 c5ea03a023 feat(ngModel):handle ime events (#13891)
PR Close: #13891
2017-01-29 12:14:32 -06:00
Dimitri Benin 5f40e5ba21 fix(testing): async/fakeAsync/inject/withModule helpers should pass through context to callback functions (#13718)
Make sure that context (`this`) that is passed to functions generated by test helpers is passed through to the callback functions. Enables usage of Jasmine's variable sharing system to prevent accidental memory leaks during test runs.
2017-01-29 12:08:53 -06:00
Dzmitry Shylovich d69717cf79 feat(forms): add email validator (#13709)
Closes #13706

PR Close #13709
2017-01-29 12:07:05 -06:00
Victor Berchet 827c3fe199 fix(compiler): fix missing translations handling (#14113)
PR Close #14113
2017-01-27 12:12:06 -06:00
Gion Kunz 8775ab9495 feat(compiler): allow missing translations (#14113)
closes #13861
2017-01-27 12:10:59 -06:00
Misko Hevery 670b680b0a refactor(size): Use abstract keyword where possible to decrease file size. (#14112) 2017-01-27 12:00:58 -06:00
Jason Aden 3ef73c2b19 feat(NgComponentOutlet): add NgModule support to NgComponentOutlet directive (#14088)
Allow NgComponentOutlet to dynamically load a module, then load a component from
that module. Useful for lazy loading code, then add the lazy loaded code to the
page using NgComponentOutlet.

Closes #14043
2017-01-25 17:41:08 -08:00
Dzmitry Shylovich 83361d811d fix(core): export animation classes required for Renderer impl (#14002)
Closes #14001
2017-01-24 10:22:47 -08:00
Dzmitry Shylovich 635bf02b02 fix(router): enable loadChildren with function in aot (#13909)
Closes #11075
2017-01-18 15:56:34 -08:00
Dzmitry Shylovich e8ea741039 fix(router): routerLinkActive should not throw when not initialized (#13273)
Fixes #13270

PR Close #13273
2017-01-17 18:38:45 -06:00
Dzmitry Shylovich 1a92e3d406 refactor(router): clean up RouterLinkActive (#13273)
PR Close #13273
2017-01-17 18:37:34 -06:00
Miško Hevery d169c2434e feat(core): Add type information to injector.get() (#13785)
- Introduce `InjectionToken<T>` which is a parameterized and type-safe
  version of `OpaqueToken`.

DEPRECATION:
- `OpaqueToken` is now deprecated, use `InjectionToken<T>` instead.
- `Injector.get(token: any, notFoundValue?: any): any` is now deprecated
  use the same method which is now overloaded as
  `Injector.get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T): T;`.

Migration
- Replace `OpaqueToken` with `InjectionToken<?>` and parameterize it.
- Migrate your code to only use `Type<?>` or `InjectionToken<?>` as
  injection tokens. Using other tokens will not be supported in the
  future.

BREAKING CHANGE:
- Because `injector.get()` is now parameterize it is possible that code
  which used to work no longer type checks. Example would be if one
  injects `Foo` but configures it as `{provide: Foo, useClass: MockFoo}`.
  The injection instance will be that of `MockFoo` but the type will be
  `Foo` instead of `any` as in the past. This means that it was possible
  to call a method on `MockFoo` in the past which now will fail type
  check. See this example:

```
class Foo {}
class MockFoo extends Foo {
  setupMock();
}

var PROVIDERS = [
  {provide: Foo, useClass: MockFoo}
];

...

function myTest(injector: Injector) {
  var foo = injector.get(Foo);
  // This line used to work since `foo` used to be `any` before this
  // change, it will now be `Foo`, and `Foo` does not have `setUpMock()`.
  // The fix is to downcast: `injector.get(Foo) as MockFoo`.
  foo.setUpMock();
}
```

PR Close #13785
2017-01-17 15:34:54 -06:00
Joao Dias 8c7e93bebe fix(core): Add type information to differs
CHANGES:

- Remove unused `onDestroy` method on the `KeyValueDiffer` and
  `IterableDiffer`.

DEPRECATION:

- `CollectionChangeRecord` is renamed to `IterableChangeRecord`.
  `CollectionChangeRecord` is aliased to `IterableChangeRecord` and is
  marked as `@deprecated`. It will be removed in `v5.x.x`.
- Deprecate `DefaultIterableDiffer` as it is private class which
  was erroneously exposed.
- Deprecate `KeyValueDiffers#factories` as it is private field which
  was erroneously exposed.
- Deprecate `IterableDiffers#factories` as it is private field which
  was erroneously exposed.

BREAKING CHANGE:

- `IterableChangeRecord` is now an interface and parameterized on `<V>`.
  This should not be an issue unless your code does
  `new IterableChangeRecord` which it should not have a reason to do.
- `KeyValueChangeRecord` is now an interface and parameterized on `<V>`.
  This should not be an issue unless your code does
  `new IterableChangeRecord` which it should not have a reason to do.

Original PR #12570

Fixes #13382
2017-01-09 18:56:34 -05:00
shlomiassaf 8578682dcf feat(NgComponentOutlet): add NgComponentOutlet directive
Add NgComponentOutlet directive that can be used to dynamically create
host views from a supplied component.

Closes #11168
Takes over PR #11235
2017-01-06 19:30:38 -05:00
Misko Hevery c0178de0e2 feat(NgTemplateOutlet): Make NgTemplateOutlet compatible with * syntax
BREAKING CHANGE:

- Deprecate `ngOutletContext`. Use `ngTemplateOutletContext` instead
2017-01-06 19:30:20 -05:00
Matias Niemelä 9211a22039 feat(animations): support function types in transitions
Closes #13538
Closes #13537
2017-01-06 19:29:46 -05:00
Matias Niemelä 3f67ab074a feat(animations): expose the `triggerName` within the transition event
Closes #13600
2017-01-06 19:29:45 -05:00
Matias Niemelä 4bae4b3bb5 feat(animations): expose the `element` value within transition events 2017-01-06 19:29:45 -05:00
Tobias Bosch 465516b905 refactor(core): remove backwards compatibility of `SimpleChange`
BREAKING CHANGE:
`SimnpleChange` now takes an additional argument that defines
whether this is the first change or not.
2017-01-03 13:05:05 -08:00
Tobias Bosch db49d422f2 refactor(compiler): generate less code for bindings to DOM elements
Detailed changes:
- remove `UNINITIALIZED`, initialize change detection fields with `undefined`.
  * we use `view.numberOfChecks === 0` now everywhere
    as indicator whether we are in the first change detection cycle
    (previously we used this only in a couple of places).
  * we keep the initialization itself as change detection get slower without it.
- remove passing around `throwOnChange` in various generated calls,
  and store it on the view as property instead.
- change generated code for bindings to DOM elements as follows:
  Before:
  ```
  var currVal_10 = self.context.bgColor;
  if (jit_checkBinding15(self.throwOnChange,self._expr_10,currVal_10)) {
    self.renderer.setElementStyle(self._el_0,'backgroundColor',((self.viewUtils.sanitizer.sanitize(jit_21,currVal_10) == null)? null: self.viewUtils.sanitizer.sanitize(jit_21,currVal_10).toString()));
    self._expr_10 = currVal_10;
  }
  var currVal_11 = jit_inlineInterpolate16(1,' ',self.context.data.value,' ');
  if (jit_checkBinding15(self.throwOnChange,self._expr_11,currVal_11)) {
    self.renderer.setText(self._text_1,currVal_11);
    self._expr_11 = currVal_11;
  }
  ```,
  After:
  ```
  var currVal_10 = self.context.bgColor;
  jit_checkRenderStyle14(self,self._el_0,'backgroundColor',null,self._expr_10,self._expr_10=currVal_10,false,jit_21);
  var currVal_11 = jit_inlineInterpolate15(1,' ',self.context.data.value,' ');
  jit_checkRenderText16(self,self._text_1,self._expr_11,self._expr_11=currVal_11,false);
  ```

Performance impact:
- None seen (checked against internal latency lab)

Part of #13651
2017-01-03 13:05:05 -08:00
Tsuyoshi Ito b2ae7b607e docs(Core): fix API docs for ContentChild and ViewChildren (#13656)
Move the documentations of the ContentChild and ViewChildren decorators
so that they appear correctly on angular.io.

Closes #13625
2016-12-27 16:58:33 -08:00
Victor Berchet eed83443b8 chore(tslint): update tslint to 4.x (#13603) 2016-12-27 14:55:58 -08:00