Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Unclear instruction about router pathMatch in ver 13 => 14 upgrade guide #212

Open

Description

@HarlanAtWork

One of the upgrade notes about moving from Angular 13 to 14 reads "If you are defining routes with pathMatch, you may have to cast it to Route or Routes explicitly. Route.pathMatch is no longer compatible with string type." I may have to cast what?

The second sentence contradicts the interface declaration at https://angular.io/api/router/Route, which is:

pathMatch?: 'prefix' | 'full'

So, it's still a string type. How do you cast that to Route or Routes?

More specifically, if my existing definition of routes begins

const routes: Routes = [
  { path: '', pathMatch: 'full', component: HomeComponent },

then what is the upgrade note telling me I have to do? Maybe "it" in the note refers to the route, and I need to cast

{ path: '', pathMatch: 'full', component: HomeComponent }

to a Route, but what does that have to do with being "no longer compatible with a string type"?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions