Commit Graph

270 Commits

Author SHA1 Message Date
Matias Niemelä fe35bc34f6 fix(animations): allow animations to be destroyed manually (#12719)
Closes #12456
Closes #12719
2016-11-08 16:21:28 -08:00
Tobias Bosch ad3bf6c54f fix(core): apply host attributes to root elements (#12761)
Fixes #12744
2016-11-08 15:46:55 -08:00
Matias Niemelä a0e9fde653 fix(animations): always normalize style properties and values during compilation (#12755)
Closes #11582
Closes #12481
Closes #12755
2016-11-08 15:45:30 -08:00
Pawel Kozlowski 22c021c57f fix(compiler): support more than 9 interpolations (#12710)
Fixes #10253
2016-11-07 12:23:03 -08:00
Matias Niemelä 383f23b578 fix(animations): always trigger animations after the change detection check (#12713)
This patch ensures that animations are run outside of change detection
thus allowing for start and done callbacks to modify application data
without causing a cycle loop.

Closes #12713
2016-11-04 15:15:27 -07:00
Victor Berchet 2a3f4d7b17 refactor: kill MapWrapper 2016-11-04 13:27:38 -07:00
Victor Berchet ec92f4b198 refactor: remove `keys()` and `values()` from MapWrapper 2016-11-04 13:27:38 -07:00
Pawel Kozlowski f0cdb428f5 fix(compiler): don't convert undefined to null literals (#11503)
Fixes #11493
2016-11-04 10:55:21 -07:00
Tobias Bosch 051d74802a fix(core): ensure that component views that have no bindings recurse into nested components / view containers. 2016-11-04 10:50:27 -07:00
Tobias Bosch f2bbef3e33 fix(core): allow to query content of templates that are stamped out at a different place
Previously, if a `TemplateRef` was created in a `ViewContainerRef`
at a different place, the content was not query able at all.

With this change, the content of the template can be queried
as if it was stamped out at the declaration place of the template.

E.g. in the following example, the `QueryList<ChildCmp>` will
be filled once the button is clicked.

```
@Component({
  selector: ‘my-comp’,
  template: ‘<button #vc (click)=“createView()”></button>’
})
class MyComp {
  @ContentChildren(ChildCmp)
  children: QueryList<ChildCmp>;

  @ContentChildren(TemplateRef)
  template: TemplateRef;

  @ViewChild(‘vc’, {read: ViewContainerRef})
  vc: ViewContainerRef;

  createView() {
    this.vc.createEmbeddedView(this.template);
  }
}

@Component({
  template: `
<my-comp>
  <template><child-cmp></child-cmp></template>
</my-comp>
`
})
class App {}
```

Closes #12283
Closes #12094
2016-11-04 10:50:27 -07:00
Tobias Bosch e3687706c7 refactor(compiler): minor cleanup 2016-11-03 16:29:51 -07:00
Tobias Bosch 9c23884da4 perf(compiler): introduce direct rendering
This allows to attach / detach embedded views and projected nodes
in a faster way.
2016-11-03 16:29:51 -07:00
Tobias Bosch d708a8859c perf(platform-browser): don’t use `DomAdapter` any more
But use the DOM apis directly.
This also creates a separate `ServerRenderer` implementation
for `platform-server` as it previously reused the `BrowserRenderer`.
2016-11-03 16:29:51 -07:00
Tobias Bosch 6fda97287e fix(compiler): support multiple components in a view container 2016-11-01 14:21:40 -07:00
Tobias Bosch bda1909ede refactor(compiler): remove `view.rootNodes` and `view.projectableNodes`
They are replaced by generated visitor functions `view.visitRootNodes` / `view.visitProjectableNodes`.
2016-11-01 11:29:15 -07:00
Tobias Bosch 642c1db9ef fix(compiler): Don’t throw on empty property bindings
Closes #12583
2016-10-31 14:43:50 -07:00
Thomas Shafer 7c16ef942e feat(core): add the find method to QueryList 2016-10-28 15:34:47 -07:00
Thomas Shafer a318b57257 refactor(core): removed extraneous interface from QueryList test 2016-10-28 15:34:47 -07:00
Tobias Bosch 178fb79b5c refactor(compiler): move host properties into DirectiveWrapper
Part of #11683
2016-10-26 14:32:24 -07:00
Victor Berchet 57051f01ce refactor: remove most facades (#12399) 2016-10-21 15:14:44 -07:00
Tobias Bosch 867494a060 fix(compiler): don't access view local variables nor pipes in host expressions (#12396)
Fixes #12004
Closes #12071
2016-10-20 15:24:58 -07:00
Victor Berchet 76dd026447 refactor: remove some facades (#12335) 2016-10-19 13:42:39 -07:00
Victor Berchet 38e2203b24 refactor(core): delete unused reflector code 2016-10-17 23:17:34 -07:00
Victor Berchet bd1dcb5f11 fix(core): fix decorator defalut values 2016-10-17 23:17:34 -07:00
Victor Berchet 3993279527 fix(core): fix property decorators
fixes #12224
2016-10-17 23:17:34 -07:00
Victor Berchet bf1e2613b2 refactor(core): cleanup decorators 2016-10-17 23:17:34 -07:00
Victor Berchet f7db0668d1 refactor(core): simplify & cleanup reflection 2016-10-17 23:17:34 -07:00
Matias Niemelä 33c8948fd3 refactor(animations): ensure animation data-structures are created only when used
Closes #12250
2016-10-14 15:43:41 -07:00
Victor Berchet e6e007e2f1 refactor(core): cleanup SpyObject (#12221) 2016-10-11 15:44:48 -07:00
Alex Eagle 8c975ed156 refactor(facade): inline StringWrapper (#12051) 2016-10-06 15:10:27 -07:00
Victor Berchet 50c37d45dc refactor: simplify arrow functions (#12057) 2016-10-04 15:57:37 -07:00
Alex Eagle b64b5ece65 refactor(facade): Remove most of StringMapWrapper facade. (#12022)
This change mostly automated by
12012b07a2
with some manual fixes.
2016-10-03 16:46:05 -07:00
Alex Eagle 0286956107 refactor(facade): Inline isBlank called with object-type argument (#11992) 2016-09-30 09:26:53 -07:00
Matias Niemelä e884f4854d feat(animations): provide aliases for :enter and :leave transitions (#11991) 2016-09-30 09:15:56 -07:00
Alex Eagle 41c8c30973 chore(lint): remove unused imports (#11923)
This was done automatically by tslint, which can now fix issues it finds.
The fixer is still pending in PR https://github.com/palantir/tslint/pull/1568
Also I have a local bugfix for https://github.com/palantir/tslint/issues/1569
which causes too many imports to be deleted.
2016-09-27 17:12:25 -07:00
Marc Laval 61129fa12d fix(compiler): move detection of unsafe properties for binding to ElementSchemaRegistry (#11378) 2016-09-27 17:10:02 -07:00
Matias Niemelä f1b6c6efa1 refactor(animations): ensure animation input/outputs are managed within the template parser (#11782)
Closes #11782
Closes #11601
Related #11707
2016-09-24 05:37:04 +09:00
Victor Berchet c041b93418 refactor(TemplateParser): clearer error message for on* binding (#11802)
fixes #11756
2016-09-22 10:31:18 -07:00
Chuck Jazdzewski 131626fc61 fix(compiler): Safe property access expressions work in event bindings (#11724) 2016-09-20 14:54:53 -07:00
Victor Berchet 0dc15eb64a fix(ContentChild): query descendants by default
fixes #1645
2016-09-19 10:42:46 -07:00
Victor Berchet cba885a1fb refactor: code cleanup 2016-09-19 10:42:46 -07:00
Jason Choi df4254ae89 refactor(facade): move isPromise to core private (#10573) 2016-09-18 15:55:08 -07:00
Tobias Bosch 42d442dcd5 refactor(core): add a name to all decorators and other fixes 2016-09-12 22:47:54 -07:00
Tobias Bosch 63e15ffaec refactor(core): remove `…Metadata` for all decorators and use the decorator directly.
BREAKING CHANGE:
- all `…Metadata` classes have been removed. Use the corresponding decorator
  as constructor or for `instanceof` checks instead.
- Example:
  * Before: `new ComponentMetadata(…)`
  * After: `new Component(…)`
- Note: `new Component(…)` worked before as well.
2016-09-12 22:47:54 -07:00
Tobias Bosch 1b15170c89 refactor(core): simplify decorators
Every decorator now is made of the following:
- a function that can be used
as a decorator or as a constructor. This function
also can be used for `instanceof` checks.
- a type for this function (callable and newable)
- a type that describes the shape of the data
  that the user needs to pass to the decorator
  as well as the instance of the metadata

The docs for decorators live at the followig places
so that IDEs can discover them correctly:
- General description of the decorator is placed on the
  `...Decorator` interface on the callable function
  definition
- Property descriptions are placed on the interface
  that describes the metadata produces by the decorator
2016-09-12 22:47:54 -07:00
Victor Berchet 5a4e46db20 refactor(tests): simplify code (#11485) 2016-09-09 12:04:38 -07:00
Matias Niemelä 6a2bbffe10 fix(animations): allow `group()` to be used as entry point for an animation trigger (#11419)
Closes #11312
Closes #11419
2016-09-08 12:20:07 -07:00
PatrickJS 3ff816afa6 style(CompileMetadataResolver): better error message (#11401) 2016-09-07 14:09:25 -07:00
Hans d26a827494 fix(lazy-loading): fix an issue with webpack and lazy loader. (#11387)
The issue was introduced in PR#11049.
2016-09-06 12:06:18 -07:00
Martin Probst ebc8e808a9 feat(router): register NgModuleFactory objects. (#11211)
When lazily loading code, users need to be able to get hold of the
NgModuleFactory. For SystemJS environments, the SystemJS registry serves
this purpose. However other environments, such as modules compiled with
Closure compiler, do not expose exports object or a path based registry.

For these environments, `@NgModule` objects can include an identifier, and
the loading code can then pass `loadModule(id).then(() =>
getNgModule(id))` to the router.
2016-09-01 13:46:08 -07:00
Matias Niemelä c9e5b599e4 fix(animations): ensure parent animations are triggered before children (#11201) 2016-09-01 13:24:26 -07:00
Matias Niemelä 562c8263dc fix(animations): ensure animation callbacks are fired for embedded views 2016-08-31 15:46:23 -07:00
Tobias Bosch cc89ef6c8c fix(core): report errors for missing di tokens correctly (#11209) 2016-08-31 14:47:56 -07:00
Victor Berchet 1818056912 fix(TemplateParser): disallow event-property binding even with the NO_ERRORS_SCHEMA
closes #11026
2016-08-30 21:32:24 -07:00
Victor Berchet 1df69cb4d2 fix(DomSchemaRegistry): detect invalid elements 2016-08-30 21:32:03 -07:00
Miško Hevery 979657989b fix(packages): use ES modules for primary build (#11120) 2016-08-30 18:07:40 -07:00
Tobias Bosch d7de5c4f8e refactor(compiler): replace `CompileIdentifierMap` with regular `Map`
closes #11145

Also rename `CompileIdentifierMetadata.runtime` into `CompileIdentifierMetadata.reference`.

Also remove `CompileIdentifierMetadata.equalsTo` as
now it is enough to just check the `reference` fields for equality.
2016-08-29 12:45:27 -07:00
Marc Laval 7dee1ee4cf test(core): update ErrorHandler tests to handle browsers without stack (#11141)
Fixes #11114
2016-08-29 08:17:45 -07:00
Misko Hevery 7c07bfff97 fix(errors): [2/2] Rename Exception to Error; remove from public API
BREAKING CHANGE:

Exceptions are no longer part of the public API. We don't expect that anyone should be referring to the Exception types.

ExceptionHandler.call(exception: any, stackTrace?: any, reason?: string): void;
change to:
ErrorHandler.handleError(error: any): void;
2016-08-26 10:37:17 -07:00
Misko Hevery 86ba072758 fix(errors): [1/2] Rename Exception to Error; remove from public API 2016-08-26 10:37:17 -07:00
Victor Berchet b9647b7347 fix(i18n): change default locale from `en_US` to `en-US` (#11103) 2016-08-26 10:30:10 -07:00
Igor Minar 811962b2bb refactor: rename SanitizationService to Sanitizer and DomSanitizationService to DomSanitizer (#11085)
BREAKING CHANGE: Previously inconsistently named APIs SanitizationService and DomSanitizationService were renamed to Sanitizer and DomSanitizer
2016-08-25 15:41:19 -07:00
Marc Laval cbe0976426 test: improve perfs by removing unneeded TestBed.compileComponents() calls (#11083) 2016-08-25 14:56:14 -07:00
Igor Minar ea2e5521e8 refactor: replace any[] with Provider[] where possible 2016-08-25 13:29:03 -07:00
Matias Niemelä 4f8f8cfc66 feat(animations): make sure animation callback reports the totalTime (#11022)
Closes #11022
2016-08-24 16:55:00 -07:00
Alex Rickabaugh 8b782818f5 feat(linker): Allow configurable module prefixes and suffixes. (#11049) 2016-08-24 16:54:42 -07:00
Chuck Jazdzewski bd510ccdbb fix(core): assigns an overriden name to constructor named constructor (#11043)
Fixes #10545
2016-08-24 10:21:13 -07:00
Pawel Kozlowski aa5c8ca61f fix(compiler): throw descriptive error meesage for invalid NgModule providers (#10947)
Fixes #10714
2016-08-23 16:18:41 -07:00
Igor Minar 4a740f23a4 refactor(core): remove deprecated @Component.directives and @Component.pipes
BREAKING CHANGE: previously deprecated @Component.directives and @Component.pipes support was removed.

All the components and pipes now must be declarated via an NgModule. NgModule is the basic
compilation block passed into the Angular compiler via Compiler#compileModuleSync or #compileModuleAsync.

Because of this change, the Compiler#compileComponentAsync and #compileComponentSync were removed as well -
any code doing compilation should compile module instead using the apis mentioned above.

Lastly, since modules are the basic compilation unit, the ngUpgrade module was modified to always require
an NgModule to be passed into the UpgradeAdapter's constructor - previously this was optional.
2016-08-23 09:59:00 -07:00
Igor Minar 3c2b2ff332 test: fix existing tests by removing usage of obsolete stuff like component level directives, AsyncCompleter and TestComponentBuilder 2016-08-23 09:59:00 -07:00
Matias Niemelä 45e8e73670 refactor(animations): deport TCB away from animation-land forever (#10892)
* feat(animations): support animation trigger template callbacks

* refactor(animations): deport TCB away from animation-land forever
2016-08-22 17:18:25 -07:00
Matias Niemelä 3c561475c8 refactor(animations): add an onStart handler for AnimationPlayer (#10360) 2016-08-22 16:39:52 -07:00
Kara ece7985b8a chore(formatting): fix formatting for component fixture spec (#10986) 2016-08-22 10:20:21 -07:00
Kara 9883e19e2e fix(tests): remove fit in component_fixture_spec (#10961) 2016-08-19 17:12:58 -07:00
Victor Savkin c56f3f2246 fix(compiler): do not autoinclude components declared as entry points (#10898) 2016-08-19 15:59:50 -07:00
Julie Ralph 917d43e108 refactor(tests): add ComponentFixture tests (#10910)
Remove old TestComponentBuilder tests, and keep relevant
ComponentFixture tests as component_fixture_spec.
2016-08-19 15:46:40 -07:00
Miško Hevery 8a5eb08672 fix(fakeAsync): have fakeAsync use Proxy zone. (#10797)
Closes #10503

It is possible for code in `beforeEach` to capture and fork a zone
(for example creating `NgZone` in `beforeEach`). Subsequently the code
in `it` may chose to do `fakeAsync`. The issue is that because the
code in `it` can use `NgZone` from the `beforeEach`. it effectively can
escape the `fakeAsync` zone. A solution is to run all of the test in
`ProxyZone` which allows a test to dynamically replace the rules at any
time. This allows the `beforeEach` to fork a zone, and then `it` to
retroactively became `fakeAsync` zone.
2016-08-19 12:10:53 -07:00
Chuck Jazdzewski a5c0349d88 refactor(core): Removed linker test references to TestComponentBuilder (#10903)
Removed references to TestComponentBuilder from:
  query_integration_spec.ts
  regression_integration_spec.ts
  security_integration_spec.ts
  view_injector_integration_spec.ts
2016-08-17 16:52:39 -07:00
Jason Choi c48021ab97 refactor(compiler): move test/test_bindings to testing/test_bindings (#10081)
`test_bindings` is used in core test cases too, but `test` should be
private to the package, so it should live in `testing`.
2016-08-17 16:37:31 -07:00
Craig 0b62b6f783 refactor(debug): switch tests from TCB to use TestBed (#10756) 2016-08-17 16:27:54 -07:00
Craig 895c542a20 refactor(directiveLifecycle): switch test from TCB to use TestBed (#10768) 2016-08-17 16:17:07 -07:00
Chuck Jazdzewski 6f18bd18bb refactor(core): Removed linker test reference to TestComponentBuilder (#10867)
Removed TestComponentBuilder references from ng_container_integration_spect.ts
2016-08-17 15:45:29 -07:00
Victor Savkin 4be863c223 Remove TCB (#10900)
* refactor(webworker): change tests not to use TestComponentBuilder

* refactor(core): change tests not to use TestComponentBuilder
2016-08-17 15:05:22 -07:00
Chuck Jazdzewski 4829fbb95c refactor(core): Remove linker test references to TestComponentBuilder (#10869)
Removed TestComponentBuilder references from projection_integration_spec.ts
2016-08-17 11:19:38 -07:00
vsavkin 740e80492d refactor(core): update entry_components_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
vsavkin cc22b051e3 refactor(core): update change_detection_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
vsavkin 75405ae0f5 refactor(core): update forward_ref_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
Matias Niemelä f12d51992d fix(animations): report errors for missing host-level referenced animations (#10650)
Closes #10650
2016-08-17 08:00:49 -07:00
Chuck Jazdzewski 0a22e8eefd refactor(core): Removing linker test references to TestComponentBuilder (#10865)
Removed references to TestComponentBuilder from integration_spec.ts
2016-08-17 07:15:35 -07:00
Igor Minar 73a9ee4a05 Remove component resolver (#10858)
* refactor(core): remove deprecated ComponentResolver

BREAKING CHANGE: deprecated ComponentResolver was removed

Please follow deprecation instruction and migrate your code to use ComponentFactoryResolver.

* refactor(common): remove deprecated NgSwitchWhen directive

BREAKING CHANGE: previously deprecated NgSwitchWhen directive was removed, use NgSwitchCase instead
2016-08-16 16:48:32 -07:00
Julie Ralph a86c554a8e refactor(core/testing): remove deprecated ViewMetadata (#10837)
Note that this doesn't actually remove all uses, but makes them
private.
2016-08-16 13:59:06 -07:00
Julie Ralph 4c9900dc3a refactor(testing): remove deprecated testing functions (#10832)
Remove TestComponentBuilder, addProviders, and withProviders. These
were deprecated in rc5 - see the changelog for update information.

Note - this does not actually remove the functions, but makes them
internal only. They will be removed from the codebase entirely
at a later time.
2016-08-15 21:40:37 -07:00
Miško Hevery bec5c5fdad refactor(Provider): remove deprecated provider/bind API (#10652)
Closes #9751

BREAKING CHANGE:

These forms of providers are no longer accepted:
  bind(MyClass).toFactory(...)
  new Provider(MyClass, toFactory: ...)

We now only accept:
  {provider: MyClass, toFactory: ...}
2016-08-15 19:37:42 -07:00
Igor Minar 3f5331be9d refactor(chore): remove deprecated NgZoneError (#10822)
BREAKING CHANGE: previously deprecated NgZoneError has been removed
2016-08-15 16:10:30 -07:00
Chuck Jazdzewski 48751cceae refactor(core): Removed deprecated Query and ViewQuery (#10820)
BREAKING CHANGE: previously deprecated Query and ViewQuery  were removed; see deprecation notice for migration instructions.
2016-08-15 16:07:55 -07:00
Chuck Jazdzewski 4a9745ef78 refactor(core): Remove deprecated DynamicComponentLoader (#10759)
BREAKING CHANGE: previously deprecated DynamicComponentLoader was removed; see deprecation notice for migration instructions.
2016-08-15 16:07:19 -07:00
Victor Berchet ce4eae65a7 feat(i18n): provide LOCALE_ID and NgLocalization 2016-08-13 06:18:25 -07:00
Igor Minar f84c3fdc5f refactor(ApplicationRef): remove all previously deprecated ApplicationRef apis
BREAKING CHANGE: All previously deprecated ApplicationRef apis have been removed.

Please follow the deprecation instructions to migrate your code.
2016-08-12 17:59:30 -07:00
Chuck Jazdzewski a235ae16ed refactor(core): Removed deprecated DebugNode.inject() (#10751)
BREAKING CHANGE: previously deprecated DebugNode#inject was removed, see deprecation notice for migration instructions.
2016-08-12 15:57:23 -07:00
Marc Laval 6a011f4e8e test(security): work around an escaping bug in IE9 (#10493) 2016-08-12 10:34:55 -07:00