Angular2 with matrix url notation

后端 未结 3 1074
一个人的身影
一个人的身影 2020-12-13 18:39

Is the matrix url notation the \"default\" to creating urls with parameters or is better to use the \"old\" notation with ? and &. I didn\'t understand it on the angular

3条回答
  •  春和景丽
    2020-12-13 19:27

    Both notations can be used but there is a restriction for the "old" notation. You can have only one question mark one question mark character in the URL.

    With the matrix params, you can have different queries for different segments.

    When is useful?

    Add queries params for your auxiliaries router outlets.

    For specials cases like one view with two components and each component has its own pagination information.

    You want to keep that information if the user goes back to this view.

提交回复
热议问题