Backtracking
Let's illustrate backtracking one more time. If the taken path through the configuration does not "consume" the whole url, the router backtracks to try an alternative path.
Say we have this configuration:
[ { path: 'a', children: [ { path: 'b', component: ComponentB } ] }, { path: ':folder', children: [ { path: 'c', component: ComponentC } ] } ]
When navigating to
/a/c
, the router will start with the first route. The /a/c
URL starts with
path: 'a'
, so the router will try to match
/c
with
b
. Because it is unable to do that, it will backtrack and will match
a
with :folder
, and then
c
with
c
.