5238 Commits

Author SHA1 Message Date
Georgios Kalpakas
7670cc1a86 feat(upgrade): export VERSION from upgrade/static ()
PR Close 
2017-02-01 09:29:51 -06:00
Georgios Kalpakas
ea63676970 refactor(upgrade): use shared code in downgradeNg2Component() ()
This unified the implementations of dynamic's `downgradeNg2Component()` and
static's `downgradeComponent()`.
2017-02-01 09:29:51 -06:00
Georgios Kalpakas
1367cd9569 fix(upgrade): respect hierarchical injectors for downgraded components ()
Correctly wire up hierarchical injectors for downgraded components in
`upgrade/static`: Downgraded components inherit the injector of the first
downgraded component up the DOM tree.

This is similar to (part of) d91a86a, but for `upgrade/static`.

POSSIBLE BREAKING CHANGE:

In order to enable more control over the wiring of downgraded components and
their content (which eventually allows better control over features like
injector setup and content projection), it was necessary to change the
implementation of the directives generated for downgraed components.

The directives are now terminal and manually take care of projecting and
compiling their contents in the post-linking function. This is similar to how
the dynamic version of `upgrade` does it.

This is not expected to affect apps, since the relative order of individual
operations is preserved. Still, it is difficult to predict how every possible
usecase may be affected.
2017-02-01 09:29:51 -06:00
Georgios Kalpakas
9aafdc7b02 feat(upgrade): allow non-element selectors for downgraded components ()
This affects the dynamic version of `upgrade` and makes it more consistent with
the static version, while removing an artificial limitation.

This commit also refactors the file layout and code, in order to share code wrt
to dowgrading components between the dynamic and static versions.
2017-02-01 09:29:51 -06:00
Georgios Kalpakas
1f90f29369 feat(upgrade): return a function (instead of array) from downgradeInjectable() ()
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
Miško Hevery
e0e5e78835 fix: lint errors to make circle-ci green 2017-01-31 19:01:48 -06:00
Alex Eagle
b4214d60a6 fix(compiler): allow expressions or functions in extends ()
Fixes 

PR Close 
2017-01-31 18:35:10 -06:00
Victor Berchet
5921c872b6 fix(compiler): only lex messages that are needed by angular ()
To avoid the lexer erroring on syntax not supported by Angular.

PR Close 
2017-01-31 16:21:55 -06:00
Tobias Bosch
52b21275f4 feat(core): view engine - add debug information ()
Creates debug information for the renderer,
and also reports errors relative to the
declaration place in the template.

Part of 

PR Close 
2017-01-31 16:21:54 -06:00
Chuck Jazdzewski
49fb8143e8 fix(language-service): do not crash when Angular cannot be located ()
Fixes 

PR Close 
2017-01-31 15:45:52 -06:00
cexbrayat
5f2b3173d7 fix(http): use params without RequestOptions ()
`params` has been introduced in 4.0.0-beta.0

Before:

    http.get(url, new RequestOptions({params: searchParams}))

After:

    http.get(url, {params: searchParams})

Fixes 

PR Close 
2017-01-31 15:44:49 -06:00
evan Liu
c87c3bec93 feat(router): deprecate preserveQueryParams,add queryParamsHandling ()
PR Close 
2017-01-31 15:43:25 -06:00
Dzmitry Shylovich
2ffa1a71aa docs(forms): fix FormArray description ()
Closes 

PR Close 
2017-01-31 15:42:42 -06:00
Toxicable
94f84c5d7e fix(forms): Verify functions passed into async validators returns Observable or Promise () 2017-01-31 12:15:56 -06:00
Dzmitry Shylovich
ff290af38c fix(common): introduce isObservable method ()
Closes 

PR Close 
2017-01-31 12:14:19 -06:00
Dzmitry Shylovich
fe441186e7 fix(common): add PopStateEvent interface ()
Closes 

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

PR Close 
2017-01-31 11:38:30 -06:00
Dzmitry Shylovich
6c7300c7de fix(forms): async validator cancels previous subscription when input has changed ()
Fixes 
Fixes 
Fixes 
Fixes 

PR Close 
2017-01-31 11:37:25 -06:00
Alex Eagle
22058298d3 fix(closure): suppress some closure compiler warnings ()
PR Close 
2017-01-30 18:34:14 -06:00
Dzmitry Shylovich
1df9319af1 fix(forms): fix broken unit test () 2017-01-30 10:07:09 -08:00
Toxicable
7b7ae5fe56 feat(forms): add equalsTo validator ()
PR Close: 
2017-01-29 12:22:24 -06:00
WilliamKoza
94b62c963d fix(common) add interface PipeTransform to Async pipe ()
PR Close 
2017-01-29 12:18:55 -06:00
Dzmitry Shylovich
579567ca79 fix(router): fix CanActivateChild guard provided in a lazy loaded module ()
Closes 

PR Close 
2017-01-29 12:17:03 -06:00
Dzmitry Shylovich
47d41d492b fix(router): fix navigation from the root component ngOnInit hook ()
Closes 

PR Close 
2017-01-29 12:16:12 -06:00
Dzmitry Shylovich
e075b1ba83 fix(router): fix CanActivate redirect to the root on initial load ()
Closes 

PR Close 
2017-01-29 12:15:46 -06:00
Dzmitry Shylovich
029f558d45 fix(forms): select shows blank line when nothing is selected in IE/Edge ()
Closes 

PR Close 
2017-01-29 12:15:11 -06:00
执衡
c5ea03a023 feat(ngModel):handle ime events ()
PR Close: 
2017-01-29 12:14:32 -06:00
Dzmitry Shylovich
cd3901f774 fix(platform-browser): remove style nodes on destroy ()
Closes 

PR Close 
2017-01-29 12:10:44 -06:00
Dzmitry Shylovich
a64c9b5d5b refactor(platform-browser): polishing () 2017-01-29 12:10:39 -06:00
Dzmitry Shylovich
863285a4b0 fix(core): add bootstrapped modules into platform modules list ()
Closes 

PR Close 
2017-01-29 12:09:46 -06:00
Dimitri Benin
5f40e5ba21 fix(testing): async/fakeAsync/inject/withModule helpers should pass through context to callback functions ()
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 ()
Closes 

PR Close 
2017-01-29 12:07:05 -06:00
Georgios Kalpakas
00979838ef refactor(upgrade): allow Closure advanced optimizations in UpgradeComponent ()
Get rid of the dynamic invocation style used in `callLifecycleHook()`, which
would break under Closure Compiler's advanced optimizations.
Related to https://github.com/angular/angular/pull/13020#discussion_r93492935.

PR Close 
2017-01-29 12:02:52 -06:00
Dzmitry Shylovich
a277e97dd7 fix(core): ViewContainerRef.indexOf doesn't throw error when empty ()
PR Close 
2017-01-29 11:50:23 -06:00
Dzmitry Shylovich
9e5617e41e fix(http): remove dots from jsonp callback name ()
PR Close 
2017-01-29 11:49:40 -06:00
Nuno Arruda
0854a5dea4 style(docs): update copyright years () 2017-01-27 20:47:14 -08:00
Jason Aden
c37af2af5a refactor(core): simplify ReflectiveInjector by removing code for Dart implementation ()
ReflectiveInjector previously used two strategies for resolving dependencies. These
were to support the Dart implementation, but are no longer needed. A result of this
PR is there is no longer a 20 dependency limit and the generated code is smaller.

PR Close 
2017-01-27 13:22:32 -08:00
Igor Minar
da41a954b5 docs: branding fixes ()
Angular 1.x -> AngularJS
Angular 1 -> AngularJS
Angular1 -> AngularJS
Angular 2+ -> Angular
Angular 2.0 -> Angular
Angular2 -> Angular

I have deliberately not touched any of the symbol names as that would cause big merge collisions with Tobias's work.

All the renames are in .md, .json, and inline comments and jsdocs.

PR Close 
2017-01-27 15:03:11 -06:00
Igor Minar
5a997ef4f0 docs: remove obsolete bundles/overview.md file () 2017-01-27 15:02:59 -06:00
Misko Hevery
d339d8b81d refactor(abstract): Use abstract keyword where possible to decrease file size. ()
PR Close: 
2017-01-27 12:32:22 -08:00
Victor Berchet
827c3fe199 fix(compiler): fix missing translations handling ()
PR Close 
2017-01-27 12:12:06 -06:00
Gion Kunz
8775ab9495 feat(compiler): allow missing translations ()
closes 
2017-01-27 12:10:59 -06:00
Victor Berchet
5885c52c1f refactor(compiler): add ability to get the context around a ParseLocation () 2017-01-27 12:10:47 -06:00
Tobias Bosch
f802194c18 refactor(core): have different data types for each node. ()
Also have a new node type for queries.

This leads to less memory usage and better performance.

Deep Tree Benchmark results (depth 11):
- createAndDestroy (view engine vs current codegen):
  * pureScriptTime: 78.80+-4% vs 72.34+-4%
  * scriptTime: 78.80+-4% vs 90.71+-9%
  * gc: 5371.66+-108% vs 9717.53+-174%
  * i.e. faster when gc is also considered and about 2x less memory usage!
- update unchanged

Part of 
PR Close 
2017-01-27 12:08:54 -06:00
Dzmitry Shylovich
7ad616a177 fix(common): DatePipe doesn't throw for NaN ()
Fixes 

PR Close 
2017-01-27 12:07:47 -06:00
Misko Hevery
670b680b0a refactor(size): Use abstract keyword where possible to decrease file size. () 2017-01-27 12:00:58 -06:00
Victor Berchet
f7fba74c58 feat(compiler): do not parse xtb messages not needed by angular ()
fixes 

PR Close 
2017-01-27 11:52:57 -06:00
Peter Bacon Darwin
20b454cbc9 fix(upgrade): detect async downgrade component changes ()
This commit effectively reverts 7e0f02f but for `upgrade/static`
as it was an invalid fix for , that created a more significant
bug, which was that changes were not always being detected.

Angular 1 digests should be run inside the ngZone to ensure
that async changes are detected.

We don't know how to fix  without breaking change detection
at this stage. That issue is triggered by async operations, such as
`setTimeout`, being triggered inside scope watcher functions.

One could argue that watcher functions should be pure and not do
work such as triggering async operations. It is possible that the
original use case could be supported by moving the debounce
logic into the watch listener function, which is only called if the
watched value actually changes.

See 

PR Close 
2017-01-27 11:51:55 -06:00
Bowen Ni
665dde2e5c refactor(compiler): improve error messages in aot compiler ()
Previously aot compiler prints stack traces when it fails to resolve.
New behavior: aot compiler outputs the error message.
Example: https://gist.github.com/bowenni/a7fe81d916e8cd4a06b0e133436f40fb

PR Close 
2017-01-27 11:49:38 -06:00
Peter Bacon Darwin
b7763559cd build(aio): move doc-gen stuff from angular.io () 2017-01-26 23:46:59 -08:00