Commit Graph

405 Commits

Author SHA1 Message Date
Victor Berchet 50c37d45dc refactor: simplify arrow functions (#12057) 2016-10-04 15:57:37 -07:00
Chuck Jazdzewski 43d3a84df3 Revert "refactor: add license header to JS files & format files (#12035)"
This reverts commit 8310c91823.
2016-10-04 14:06:41 -07:00
Victor Berchet 8310c91823 refactor: add license header to JS files & format files (#12035) 2016-10-04 13:15:49 -07:00
Connor Wyatt c143fee849 refactor(routerLinkActive): optimised routerLinkActive active check code (#11968)
Modify routerLinkActive to optimise performance by removing unnecessary iteration. By replacing Array.reduce with Array.some, the loop will break when it finds an active link. Useful if used on the parent of a large group of routerLinks. Furthermore, if a RouterLink is active it will not check the RouterLinkWithHrefs.
2016-09-30 09:42:54 -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
Trotyl Yu 745e10e6d2 docs(router_config): add missing quote (#11925) 2016-09-27 10:10:12 -07:00
Victor Savkin 31dce72b7b fix(router): update the router not to reset router state when updating root component (#11799) 2016-09-21 11:37:43 -07:00
vsavkin 5a849829c4 feat(router): add router preloader to optimistically preload routes 2016-09-20 14:53:52 -07:00
Igor Minar cb657c4b55 docs: update descriptions in package.jsons 2016-09-14 16:44:39 -07:00
Igor Minar cc7780adf7 build(npm): update to rxjs@5.0.0-beta.12
Fixes #11300
2016-09-12 12:05:00 -07:00
vsavkin a343a8e1c2 docs(router): fix typos 2016-09-12 09:47:44 -07:00
vsavkin a41c1bbdf4 docs(router): update docs of the router lifecycle interfaces 2016-09-10 16:55:14 -07:00
vsavkin f2c6157e74 docs(router): update docs of RouteModule and RouterTestingModule 2016-09-10 16:55:13 -07:00
vsavkin 32564ece27 docs(router): update RouterState docs 2016-09-10 16:55:13 -07:00
vsavkin 3eee62fa71 docs(router): update router configuration docs 2016-09-10 16:55:13 -07:00
vsavkin 617475005f docs(router): update docs of the Router service 2016-09-10 16:55:13 -07:00
vsavkin 0822066175 docs(router): update docs for router directives 2016-09-10 16:55:13 -07:00
Victor Berchet 5a4e46db20 refactor(tests): simplify code (#11485) 2016-09-09 12:04:38 -07:00
Rob Wormald d296298282 fix(build): prevent package tsconfigs from shadowing main tsconfig (#11454) 2016-09-08 15:01:22 -07:00
Trotyl Yu cc958c74ad docs(router): Fix typo of segment name and odd quote (#11409) 2016-09-07 14:10:19 -07:00
Brandon f5101782d9 docs(router): Fixed examples for router.navigate (#11263) 2016-09-02 13:42:51 -07:00
Igor Minar ddda62b1f2 docs(router): add changelog for 3.0.0-rc.2 2016-08-31 16:55:18 -07:00
Igor Minar 08e48c8f73 fix(router): correct peerDependencies info in package.json 2016-08-31 16:49:14 -07:00
Tobias Bosch 6ea5b05e7c refactor(benchmarks): make setup nicer
- simplify and correct systemjs config
- remove deep imports into Ng2 packages to work with bundles
- have separate Ng2 and Polymer bootstrap files
2016-08-31 11:24:22 -07:00
Victor Berchet 1df69cb4d2 fix(DomSchemaRegistry): detect invalid elements 2016-08-30 21:32:03 -07:00
Igor Minar 174c016104 fix(bundles): correct RxJS mapping in rollup config for umd/es5 bundles 2016-08-30 21:07:45 -07:00
Victor Berchet 0f68351979 fix(Router): fix type (#11181) 2016-08-30 21:06:38 -07:00
vsavkin c74a438f0c docs(router): fix up the exampesd 2016-08-30 20:37:35 -07:00
vsavkin c350ba29f6 fix(router): do not use rx/add/operator 2016-08-30 20:37:35 -07:00
Miško Hevery 979657989b fix(packages): use ES modules for primary build (#11120) 2016-08-30 18:07:40 -07:00
Victor Savkin e2241a2f92 fix(router): support guards navigating synchronously (#11150) 2016-08-29 17:51:38 -07:00
James Blacklock 4a44832114 fix(UrlParser) stop setting default value 'true' (matrix params) (#10946)
This was already fixed recently for query params in #10399.
2016-08-26 15:41:32 -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
Victor Berchet fc1e45db92 fix(Router): merge artifacts
closes #11063
closes #11102
2016-08-26 10:32:35 -07:00
vsavkin a2deafc50f fix(router): add an option to disable initial navigation 2016-08-26 10:32:35 -07:00
vsavkin 2fc5c57b31 feat(router): add support for custom error handlers 2016-08-26 10:32:35 -07:00
vsavkin 93f323cfa2 refactor(router): make RouterLink and RouterLinkWithHref create url in a similar way 2016-08-26 10:32:35 -07:00
vsavkin bb9dfbc578 fix(router): use encodeUri/decodeUri to encode fragment 2016-08-26 10:32:35 -07:00
vsavkin 0bb516fae2 fix(router): fix the order of guards, so canActivateChild runs before canActivate 2016-08-26 10:32:35 -07:00
vsavkin 2ffecc0e14 fix(router): update the location before activating components 2016-08-26 10:32:35 -07:00
Marc Laval 66df335998 chore(dependencies): switch from es6-shim to core-js (#10884) 2016-08-25 17:28:36 -07:00
Igor Minar ea2e5521e8 refactor: replace any[] with Provider[] where possible 2016-08-25 13:29:03 -07:00
Igor Minar 3aaf064d11 refactor(router): remove ROUTER_DIRECTIVES which were replaced by RouterModule 2016-08-25 13:29:03 -07:00
Victor Savkin f1ce7607a6 fix(router): canLoad should cancel a navigation instead of failing it (#11001) 2016-08-24 10:20:44 -07:00
Alex Rickabaugh 5ddecb18a7 feat(router): throw a helpful error when misusing forRoot() from a lazy module. (#10996) 2016-08-23 11:57:58 -07:00
Chuck Jazdzewski 39a2c39cef feat(compiler): Added "strictMetadataEmit" option to ngc (#10951)
ngc can now validate metadata before emitting to verify it doesn't
contain an error symbol that will result in a runtime error if
it is used by the StaticReflector.

To enable this add the section,

  "angularCompilerOptions": {
    "strictMetadataEmit": true
  }

to the top level of the tsconfig.json file passed to ngc.

Enabled metadata validation for packages that are intended to be
used statically.
2016-08-22 17:37:48 -07:00
Rob Wormald ca41b4f5ff feature(core): update RxJS to 5.0.0-beta.11 (#10648) 2016-08-22 17:17:23 -07:00
Victor Savkin 53c99cfc95 feat(router): add syntax sugar for confuguring RouterTestingModule (#10906) 2016-08-19 16:01:59 -07:00
Brandon cc0e3d2296 docs(router): Added additional router documentation including cheatsheet updates (#10802) 2016-08-19 15:48:09 -07:00
Julie Ralph bb7d55244d fix(zones): bump zone version to 0.6.15 (#10953)
This fixes issues with microtasks being called too early
in certain tests.
2016-08-19 14:35:26 -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
Victor Savkin 00e157dc3b refactor(router): update stability labels (#10902) 2016-08-17 15:35:30 -07:00
vsavkin 9318033294 refactor(router): update router spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
Trotyl Yu 2451eb9ded docs(router): Explanation in code should be comment (#10790) 2016-08-16 19:38:23 -07:00
Trotyl Yu ed639784d4 docs(router): Fix mismatching of code and comment (#10791) 2016-08-16 19:37:53 -07:00
Victor Savkin 24e280a21a refactor(router): remove deprecated apis (#10658) 2016-08-16 13:40:28 -07:00
Victor Savkin f7ff6c5a12 refactor(core): remove deprecated 'bootstrap' (#10831) 2016-08-16 11:15:01 -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
Victor Savkin 6b26102931 feat(router): extend support for lazy loading children (#10705) 2016-08-15 21:11:09 -07:00
Rob Wormald 73c0a9daaf fix(router): make routerLinkActiveOptions public (#10758) 2016-08-15 00:39:59 -07:00
Victor Savkin 04c6b2fe85 fix(router): location changes and redirects break the back button (#10742) 2016-08-12 14:30:51 -07:00
Victor Savkin cc6749c158 fix(router): lazy loading keeps refetching modules (#10707) 2016-08-11 22:59:53 -07:00
vsavkin f48142e679 feat(core): make ngprobe tokens pluggable 2016-08-11 22:56:10 -07:00
vsavkin 947f9c3f56 feat(router): make router.config public 2016-08-11 22:56:10 -07:00
Miško Hevery b96869afd2 refactor(Type): merge Type and ConcreType<?> into Type<?> (#10616)
Closes #9729

BREAKING CHANGE:

`Type` is now `Type<T>` which means that in most cases you have to
use `Type<any>` in place of `Type`.

We don't expect that any user applications use the `Type` type.
2016-08-10 18:21:28 -07:00
Victor Savkin 6db27153ef Router Fixes (#10579)
* fix(router): copy over data during data resolution
* fix(router): components instantiated in lazy-loaded modules should use location's injector
2016-08-10 15:53:57 -07:00
Victor Savkin c7f3aa71fb fix(router): support relative param-only navigation (#10613) 2016-08-09 17:03:17 -07:00
Marc Laval c8da7e995f test(router): Android browser does not support element.click() 2016-08-09 13:25:20 -07:00
Marc Laval 8be6b12c2b test(router): use Object.isFrozen instead of relying on an exception 2016-08-09 13:25:20 -07:00
Marc Laval 4728f29f67 test(router): increase Karma timers and add polyfills for old browsers 2016-08-09 13:25:20 -07:00
vsavkin e3aa19049f chore(router): update changelog 2016-08-09 11:02:04 -07:00
vsavkin ef1eadadcd chore(router): bump up version number 2016-08-09 11:01:17 -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
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 83e2d3d1cb refactor(RegExpWrapper): remove the facade (#10512) 2016-08-05 09:50:49 -07:00
Brandon 63b82cd730 feat(router): Allow navigation without updating the URL (#9608) 2016-08-04 11:46:09 -07:00
Victor Savkin 2eda7a5293 fix(router): provideRouter should use provideRoutes (#10488) 2016-08-03 19:35:12 -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 3d53b33391 chore: update public api and integrate minor review comments 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
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
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
Suguru Inatomi 0d6cc17252 fix(UrlParser): stop setting default value 'true' (#10399) 2016-07-30 14:34:03 -07:00
vsavkin 3c3e9ddb10 feat(router): add a validation to make sure pathMatch is set correctly 2016-07-29 12:27:43 -07:00
vsavkin 5162fb6d52 feat(router): add isActive to router 2016-07-29 12:27:43 -07:00
vsavkin 2fdb39e60a feat(router): activateroute should expose its route config 2016-07-29 12:27:43 -07:00
Tobias Bosch d0a95e35af refactor(testing): introduce new testing api to support ng modules
BREAKING CHANGE:
- deprecations:
  * `withProviders`, use `TestBed.withModule` instead
  * `addProviders`, use `TestBed.configureTestingModule` instead
  * `TestComponentBuilder`, use `TestBed.configureTestModule` / `TestBed.override...` / `TestBed.createComponent` instead.

Closes #10354
2016-07-29 04:47:18 -07:00
vsavkin 81d27daf0d fix(router): update dts files 2016-07-28 15:03:19 -07:00