18 Commits

Author SHA1 Message Date
Martin Sikora
0d55d4557f test(router): add Router regression test for hash location strategy ()
This situation can probably happen only when using
`HashLocationStrategy` and by manually changing hash that triggers a route
guard that returns a new `UrlTree`. Then hash in the browser might not
match the current route because navigation was canceled, while hash in
the URL remained set by the user.

Related to 

PR Close 
2021-04-14 18:48:26 -07:00
Andrew Scott
d28a391385 fix(router): Remove information about attached component when deactivating route ()
When we deactivate a child route, we deactivate its outlet as well as
its children. We also need to clear the stored information about the
route and the associated component.
If we do not, the context will keep these references and can result in
reactivating an outlet that was deactivated by the previous navigation.

Fixes 

PR Close 
2021-04-07 13:55:31 -07:00
Andrew Scott
dbfb50e9f4 fix(router): ensure routerLinkActive updates when associated routerLinks change ()
This commit introduces a new subscription in the `routerLinkActive` directive which triggers an update
when any of its associated routerLinks have changes. `RouterLinkActive` not only needs to know when
links are added or removed, but it also needs to know about if a link it already knows about
changes in some way.

Quick note that `from...mergeAll` is used instead of just a simple
`merge` (or `scheduled...mergeAll`) to avoid introducing new rxjs
operators in order to keep bundle size down.

Fixes 

PR Close 
2020-08-18 10:21:49 -07:00
Andrew Scott
bee44b3359 Revert "fix(router): ensure routerLinkActive updates when associated routerLinks change ()" ()
This reverts commit e0e5c9f195460c7626c30248e7a79de9a2ebe377.
Failures in Google tests were detected.

PR Close 
2020-08-18 10:21:47 -07:00
Andrew Scott
e0e5c9f195 fix(router): ensure routerLinkActive updates when associated routerLinks change ()
This commit introduces a new subscription in the `routerLinkActive` directive which triggers an update
when any of its associated routerLinks have changes. `RouterLinkActive` not only needs to know when
links are added or removed, but it also needs to know about if a link it already knows about
changes in some way.

Quick note that `from...mergeAll` is used instead of just a simple
`merge` (or `scheduled...mergeAll`) to avoid introducing new rxjs
operators in order to keep bundle size down.

Fixes 

PR Close 
2020-08-17 12:33:59 -07:00
Manduro
80d0067048 fix(router): RouterLinkActive should run CD when setting isActive ()
When using the routerLinkActive directive inside a component that is using ChangeDetectionStrategy.OnPush and lazy loaded module routes the routerLinkActive directive does not update after clicking a link to a lazy loaded route that has not already been loaded.

Also the OnPush nav component does not set routerLinkActive correctly when the default route loads, the non-OnPush nav component works fine.

regression caused by 
closes 

PR Close 
2020-06-25 11:56:26 -07:00
Joey Perrott
d1ea1f4c7f build: update license headers to reference Google LLC ()
Update the license headers throughout the repository to reference Google LLC
rather than Google Inc, for the required license headers.

PR Close 
2020-05-26 14:26:58 -04:00
Joey Perrott
698b0288be build: reformat repo to new clang@1.4.0 ()
PR Close 
2020-04-14 12:08:36 -07:00
Carlos Ortiz García
9166baf709 refactor(core): Migrate TestBed.get to TestBed.inject ()
This is cleanup/followup for PR 

PR Close 
2019-09-09 19:10:54 -04:00
Alex Rickabaugh
84dd2679a9 fix(core): require 'static' flag on queries in typings ()
This commit makes the static flag on @ViewChild and @ContentChild required.

BREAKING CHANGE:

In Angular version 8, it's required that all @ViewChild and @ContentChild
queries have a 'static' flag specifying whether the query is 'static' or
'dynamic'. The compiler previously sorted queries automatically, but in
8.0 developers are required to explicitly specify which behavior is wanted.
This is a temporary requirement as part of a migration; see
https://angular.io/guide/static-query-migration for more details.

@ViewChildren and @ContentChildren queries are always dynamic, and so are
unaffected.

PR Close 
2019-05-24 16:55:00 -04:00
Marc Laval
a566e52ca4 test(ivy): run more router tests in CI ()
PR Close 
2018-11-30 14:58:22 -08:00
Marc Laval
c2f30542e7 fix(ivy): should support components without selector ()
PR Close 
2018-11-27 10:17:35 -08:00
Marc Laval
8ce59a583b test(ivy): run router tests with ivy on CI ()
PR Close 
2018-11-21 09:19:40 -08:00
Rado Kirov
c95437f15d build(bazel): Turning on strictPropertyInitialization for Angular. ()
All errors for existing fields have been detected and suppressed with a
`!` assertion.

Issue/24571 is tracking proper clean up of those instances.

One-line change required in ivy/compilation.ts, because it appears that
the new syntax causes tsickle emitted node to no longer track their
original sourceFiles.

PR Close 
2018-06-25 07:57:13 -07:00
vsavkin
6f2939da62 fix(router): RouterLinkActive should update its state right after checking the children ()
Closes 

PR Close 
2017-10-18 11:17:55 -07:00
Tobias Bosch
b0c7ea8181 Revert "fix(router): RouterLinkActive should update its state right after checking the children ()"
This reverts commit c569b7524974200040c2abae6923cd4e6f59a13b.
As it was synched together with 5a9ed2de272912ac74ed56bfec4bdf4551f7b38e
which broke an internal test.
2017-10-18 09:58:41 -07:00
vsavkin
c569b75249 fix(router): RouterLinkActive should update its state right after checking the children ()
Closes 

PR Close 
2017-10-17 20:57:30 -07:00
Victor Berchet
82417b3ca5 fix(router): prevent RouterLinkActive from causing an infinite CD loop
fixes 
2017-04-17 10:15:44 -07:00