71 Commits

Author SHA1 Message Date
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
vsavkin
a343a8e1c2 docs(router): fix typos 2016-09-12 09:47:44 -07:00
vsavkin
0822066175 docs(router): update docs for router directives 2016-09-10 16:55:13 -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
vsavkin
93f323cfa2 refactor(router): make RouterLink and RouterLinkWithHref create url in a similar way 2016-08-26 10:32:35 -07:00
Victor Savkin
24e280a21a refactor(router): remove deprecated apis (#10658) 2016-08-16 13:40:28 -07:00
Rob Wormald
73c0a9daaf fix(router): make routerLinkActiveOptions public (#10758) 2016-08-15 00:39:59 -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
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
5162fb6d52 feat(router): add isActive to router 2016-07-29 12:27:43 -07:00
vsavkin
9d9e9c6ff1 refactor(router): take advantage of the new way of configuring modules 2016-07-27 10:24:29 -07:00
Tobias Bosch
6f4e49ed53 refactor(core): rename precompile into entryComponents.
Part of #10043

BREAKING CHANGE:
- `@Component.precompile` was renamed to `@Component.entryComponents`
  (old property still works but is deprecated)
- `ANALYZE_FOR_PRECOMPILE` was renamed to `ANALYZE_FOR_ENTRY_COMPONENTS` (no deprecations)
2016-07-26 07:04:36 -07:00
vsavkin
2b63330a36 fix(router): handle when both primary and secondary are empty-path and primary has a child 2016-07-22 18:51:35 -07:00
vsavkin
8d90a5a4cf fix(router): router link active should take all descendants into account 2016-07-22 18:51:35 -07:00
vsavkin
93a4ca652a refactor(router): renames PRIMARY_OUTLET into primary 2016-07-22 18:51:35 -07:00
vsavkin
db54a84d14 fix(router): routerLinkActive should only set classes after the router has successfully navigated 2016-07-20 17:51:21 -07:00
vsavkin
23ee29b6a2 fix(router): navigation should not preserve query params and fragment by default
BREAKING CHANGE

Previously both imperative (router.navigate) and declarative (routerLink) navigations
would preserve the current query params and fragment. This behavior turned out to
be confusing. This commit changes it.

Now, neither is preserved by default. To preserve them, you need to do the following:

router.naviage("newUrl", {preserveQueryParams: true, preserveFragment: true})

<a routerLink="newUrl" preserveQueryParams preserveFragment></a>
2016-07-20 14:30:04 -07:00
vsavkin
51e661eb74 fix(router): export navigation extras 2016-07-18 17:42:04 -07:00
vsavkin
921a17960c fix(router): lazy loaded components should use loaded injector 2016-07-18 17:42:04 -07:00
vsavkin
5cf58971f1 fix(router): update current state and url before activating components 2016-07-13 11:16:46 -07:00
vsavkin
245b0910ed feat(router): add activate and deactivate events to RouterOutlet 2016-07-08 15:01:52 -07:00
vsavkin
96a9e66616 feat(router): add the ANALYZE_FOR_PRECOMPILE provider to make dev ergonomics better 2016-07-07 18:07:10 -07:00
vsavkin
f7a0e9ecb6 fix(router): fix RouterLinKActive to work with RouterLink 2016-07-07 17:33:42 -07:00
vsavkin
37e6da6dfb refactor(router): clean up naming 2016-07-06 16:19:52 -07:00
vsavkin
8ebb8e44c8 feat(router): add support for lazily loaded modules 2016-07-06 14:38:05 -07:00
vsavkin
0c65d5cf2b fix(router): handle router outlets in ngIf 2016-06-30 22:14:42 -07:00
vsavkin
f65ebec3ed fix(router): update links when query params change 2016-06-30 22:14:42 -07:00
PatrickJS
137fff9632 fix(router): remove private and internal annotations (#9753) 2016-06-30 19:39:13 -07:00
Rob Wormald
dabf214f17 fix(router): remove private and internal annotations (#9745) 2016-06-30 14:47:55 -07:00
vsavkin
fb2539e1d5 fix(router): remove the precompile warning 2016-06-30 14:33:04 -07:00
vsavkin
3784696b9e fix(router): make the contstructor of the router service public 2016-06-28 18:39:37 -07:00
vsavkin
8c45aebc18 fix(router): make router links work on non-a tags 2016-06-28 18:39:37 -07:00
vsavkin
296a447e3c docs(router): add api docs 2016-06-28 14:49:29 -07:00
vsavkin
fcfddbf79c feat(router): add pathMatch property to replace terminal 2016-06-27 20:21:30 -07:00
vsavkin
dc64e90ab9 feat(router): use componentFactoryResolver 2016-06-27 20:21:30 -07:00
vsavkin
1a145ac500 fix(router): default exact to false in routerLinkActiveOptions 2016-06-24 12:44:32 -07:00
ScottSWu
ae75e3640a chore(lint): Added license headers to most TypeScript files
Relates to #9380
2016-06-23 09:47:54 -07:00
vsavkin
cdbf67ee05 test(router): add a test checking that guards work for child routes 2016-06-21 12:17:30 -07:00
Dimitrios Loukadakis
9a67f38728 fix(router): port fixes done on angular current router to the new one
The bugs were fixed on current angular router in the following commits:
angular/angular@b2a7fd05cb
angular/angular@fa2ce8100b
angular/angular@595bcdd1ac

Closes #12
2016-06-21 12:17:30 -07:00
vsavkin
25560ed048 feat(router): implement RouterLinkActive 2016-06-21 12:17:30 -07:00
vsavkin
2aa19fd078 feat(router): support navigating by url tree 2016-06-21 12:17:30 -07:00
vsavkin
b3e801ed9e feat(router): make it work with TypeScript 1.8 2016-06-21 12:17:30 -07:00
vsavkin
2982892acc cleanup(router): clang-format 2016-06-21 12:17:30 -07:00
vsavkin
1f3f8ef6c8 fix(router): fix nested deactivation 2016-06-21 12:17:30 -07:00
Mike Ryan
97cf0e40d5 fix(guards): Cancel in-flight guards if one returns false 2016-06-21 12:17:30 -07:00
vsavkin
6988a550ea cleanup(router): fix tslint errors 2016-06-21 12:17:30 -07:00
vsavkin
ed50e17e5b refactor(router): rename queryParameters into queryParams 2016-06-21 12:17:30 -07:00
vsavkin
33b518ad21 feat(router): update RouterLink to support query params and fragment 2016-06-21 12:17:30 -07:00
vsavkin
f04b6978fb cleanup(router): add @internal to constructors where needed 2016-06-21 12:17:30 -07:00