138 Commits

Author SHA1 Message Date
Tobias Bosch
39b92f7e54 feat: introduce TestBed.overrideProvider ()
This allows to overwrite all providers for a token, not matter
where they were defined.

This can be used to test JIT and AOT’ed code in the same way.

Design doc: https://docs.google.com/document/d/1VmTkz0EbEVSWfEEWEvQ5sXyQXSCvtMOw4t7pKU-jOwc/edit?usp=sharing
2017-05-15 13:12:10 -07:00
Matias Niemelä
38c524d655 feat(core): introduce fixture.whenRenderingDone for testing () 2017-05-12 13:49:16 -07:00
Tobias Bosch
ce1d7c4a6e refactor: use view engine also for NgModuleFactorys ()
* refactor(core): provide error message in stack for reflective DI

Fixes 

* fix(compiler): make AOT work with `noUnusedParameters`

Fixes 

* refactor: use view engine also for `NgModuleFactory`s

This is a prerequisite for being able to mock providers
in AOTed code later on.
2017-05-11 10:26:02 -07:00
Pete Bacon Darwin
d0e72a8f8f docs(*) fix dangling links in API docs ()
* docs(animations): fix links to `Component` animations

* docs(core): fix links to `ReflectiveInjector` methods

The `resolve` and other methods were moved from the
`Injector` to the `ReflectiveInjector`.

* docs(core): fix links to `Renderer`

The local links were assuming that that methods were on the
current document (e.g. `RootRenderer`), but they are actually
on the `Renderer` class.

* docs(router): fix links to methods

* docs(forms): fix links to methods

* docs(core): fix links to methods

* docs(router): fix API page links and an internal link
2017-05-09 15:51:37 -07:00
Pete Bacon Darwin
b44eb328e0 docs(core): remove link to non-existent class in InjectableDecorator ()
Closes 
2017-05-09 15:51:23 -07:00
Tobias Bosch
f0f65443c6 fix(core): detach projected views when a parent view is destroyed ()
This also clarifies via a test 
that we only update projected views when the view is created or destroyed,
but not when it is attached/detached/moved.

Fixes 

PR Close 
2017-05-08 17:49:02 -05:00
Tobias Bosch
fcc91d862f fix(core): projected views should be dirty checked when the declaring component is dirty checked. ()
Previously a projected view was only dirty checked when the
component in which it was inserted was dirty checked.

This fix changes the behavior so that a view is also dirty checked if
the declaring component is dirty checked.

Note: This does not change the order of change detection,
only the fact whether a projected view is dirty checked or not.

Fixes 
2017-05-08 17:48:58 -05:00
David Herges
c5ce0408a1 docs(core): EventEmitter docs for isAsync defaults ()
- solves 
2017-05-08 10:47:53 -07:00
Tobias Bosch
547c363473 feat: add .ngsummary.ts files to support AOT unit tests
Design doc: https://docs.google.com/document/d/1VmTkz0EbEVSWfEEWEvQ5sXyQXSCvtMOw4t7pKU-jOwc/edit?usp=sharing
2017-05-05 13:23:53 -04:00
Matias Niemelä
7f9c589ba3 feat(core): add begin and end renderer methods to track change detection 2017-05-04 15:07:27 -04:00
Igor Minar
71f5b73296 docs: fix links in api docs 2017-05-03 09:22:32 +01:00
Tobias Bosch
e263e19a2a fix(core): don’t stop change detection because of errors
- prevents unsubscribing from the zone on error
- prevents unsubscribing from directive `EventEmitter`s on error
- prevents detaching views in dev mode if there on error
- ensures that `ngOnInit` is only called 1x (also in prod mode)

Fixes 
Fixes 
Fixes 
2017-05-01 18:56:25 -04:00
Tobias Bosch
a4de214e2b fix(core): don’t set ng-version for dynamically created components ()
Angular uses the `ng-version` attribute to indicate which elements
were used to bootstrap an application. However, after 4.0 we also
added this attribute for all dynamically created components.

Fixes 

PR Close 
2017-04-28 17:41:50 -05:00
Tobias Bosch
aa8bba4865 fix(core): allow to detach OnPush components ()
Fixes 
2017-04-28 17:41:45 -05:00
Tobias Bosch
392d584572 fix(core): allow directives to inject the component’s ChangeDetectorRef. ()
When a directive lives on the same element as a component
(e.g. `<my-comp myDir>`), the directive was not able to get hold
of the `ChangeDetectorRef` of the component on that element. However,
as directives are supposed to decorate components, this is incorrect.

This commit enables this use case.

Closes 
2017-04-28 17:41:31 -05:00
Christoph Krautz
900a88b15d feat(core): allow custom selector when bootstrapping components ()
- fixes 

PR Close 
2017-04-28 17:41:04 -05:00
Alex Eagle
da668848c9 fix(core): distribute externs for testability API ()
Workaround for 

PR Close 
2017-04-19 22:46:11 -05:00
Miško Hevery
5293794316 fix: turn on nullability in the code base. 2017-04-18 12:07:33 -07:00
Miško Hevery
728c9d0632 fix(platform-browser): Update types for TypeScript nullability support
Closes 
2017-04-18 12:07:33 -07:00
Victor Berchet
cb5a7efa91 fix(core): key-value differ changes iteration ()
fixes 
2017-04-14 09:03:16 -07:00
Miško Hevery
09d9f5fe54 fix(compiler): Update types for TypeScript nullability support 2017-04-10 15:26:33 -06:00
Tobias Bosch
14fd78fd85 fix(core): fix inheritance in JIT mode for TS 2.1 ()
Fixes 
2017-03-29 16:14:51 -07:00
Victor Berchet
d58a242fe7 refactor(router): cleanup & simplification () 2017-03-29 09:44:04 -07:00
Miško Hevery
910c0d9ee7 fix(core): Update types for TypeScript nullability support () 2017-03-29 09:34:45 -07:00
Shai Reznik
49162784a8 docs(core): fix API docs for Injector.get 2017-03-28 16:57:22 -07:00
Matias Niemelä
a580f8c61f fix(animations): make sure style calculations are not computed too early ()
Closes 
2017-03-28 16:07:49 -07:00
Victor Berchet
93d48f1d89 fix(core): fix the key/value differ ()
fixes 
2017-03-28 15:50:11 -07:00
Diego Barahona
aa16ccda79 fix(core): check for undefined on normalizeDebugBindingValue ()
DebugServices is parsing false atributes values incorrectly.
Parse5 expects a string value for attributes, but currently boolean is being sent.

Closes 
2017-03-28 13:33:07 -07:00
Dzmitry Shylovich
b7fa5dec21 fix(core): improve error msg for invalid KeyValueDiffer.diff arg ()
Closes 
2017-03-28 09:37:40 -07:00
JB Nizet
d05aa70c6b docs(core): fix typo and example in InjectionToken doc ()
The doc included an example that didn't use InjectionToken.
2017-03-28 09:37:08 -07:00
Ward Bell
816b389759 docs: in doc comments, replace [aA]ngular2 with Angular () 2017-03-27 09:44:35 -07:00
Dzmitry Shylovich
c17b912eb9 refactor: use object spread operator rather than merge () 2017-03-24 14:45:33 -07:00
Igor Minar
b800a0c824 fix: prevent strictNullChecks support until is fixed () 2017-03-23 14:54:19 -07:00
Tobias Bosch
c8ab5cb0c5 fix(compiler): assume queries with no matches as static ()
This has the side effect of allowing `@Input` and `@ContentChild`
on the same property if the query is static (see the bug description
for details).

Fixes 
2017-03-23 13:37:45 -07:00
Victor Berchet
ea49a95bd9 fix(upgrade): component injectors should not link the module injector tree () 2017-03-22 15:22:38 -07:00
Chuck Jazdzewski
90d2518d9a fix(compiler): look for flat module resources using declaration module path ()
`ngc` would look for flat module resources relative to the flat module index.
`ngc` now looks for flat module resources relative to the `.d.ts` file that declarates
the component.

Fixes 

PR Close 
2017-03-21 19:05:03 -05:00
Victor Berchet
bac265fdc2 refactor(core): misc cleanup ()
PR Close 
2017-03-21 16:46:51 -05:00
Tobias Bosch
64beae9527 fix(core): mark components for check when host events trigger. ()
Fixes 

PR Close 
2017-03-21 14:27:01 -05:00
Matias Niemelä
fbccd5cd38 fix(animations): ensure empty animate() steps work at the end of a sequence ()
Closes 
Closes 

PR Close 
2017-03-21 14:26:43 -05:00
Tobias Bosch
1e8b132ade refactor(compiler): only produce log expressions for elements / text ()
This change reduces the amount of generated code by only adding `log`
calls for elements and text nodes.

We need the `log` calls to allow users to jump to the right place
in the template via source maps. However, we only need it for element
and text nodes, but not for directives, queries, … as for them we 
first locate the corresponding element or text node.

Related to 

PR Close 
2017-03-21 14:26:30 -05:00
Tobias Bosch
431eb309f3 fix(core): provide NgModuleRef in ViewContainerRef.createComponent. ()
This is needed to support the corner cases:
- usage of a `ComponentFactory` that was created on the fly via `Compiler`
- overwriting of the `NgModuleRef` that is associated to a
  `ComponentFactory` by the `ComponentFactoryResolver` from
  which it was read.

Fixes 
2017-03-21 14:26:26 -05:00
Dzmitry Shylovich
8e6995c91e fix(core): stringify shouldn't throw when toString returns null/undefined ()
Fixes 

PR Close 
2017-03-21 12:20:44 -05:00
Matias Niemelä
94da80148e fix(animations): stringify boolean values as 1 and 0 ()
Closes 
Closes 

PR Close 
2017-03-20 22:36:29 -05:00
Matias Niemelä
9bf2fb4a74 fix(animations): ensure enter/leave cancellations work ()
Closes 
Closes 

PR Close 
2017-03-20 22:36:11 -05:00
Filipe Silva
f634c62cb3 test: add systemjs+umd integration test ()
This test ensures the `__esModule` is set on UMD bundles, thus making them compatible with SystemJS@^0.22.3.

Followup from https://github.com/frankwallis/plugin-typescript/issues/185.

PR Close 
2017-03-19 12:23:07 -05:00
Tobias Bosch
f8c075ae27 fix(core): don’t create a comment for components with empty template. ()
Fixes 

PR Close 
2017-03-19 12:22:26 -05:00
Matias Niemelä
aeb99645bb test(animations): test various combinations of animations with host bindings ()
PR Close 
2017-03-19 12:21:54 -05:00
Tobias Bosch
0d3e314df0 fix(core): trigger host animations for elements that are removed. ()
Fixes 
Fixes 
2017-03-19 12:21:42 -05:00
Tobias Bosch
28ce68a13d refactor(core): view engine - change BindingType to BindingFlags () 2017-03-19 12:21:37 -05:00
Tobias Bosch
0c43535ccc fix(core): only apply WrappedValue to the binding of the pipe ()
Previously, a pipe that returned a `WrappedValue` would force the change
of the next bound property, independent of the binding in which the pipe
was used.

Now only the binding in which the `WrappedValue` is used will be assumed
as changed.

Fixes 

PR Close 
2017-03-17 17:38:36 -05:00