September 2021 update
The following answer is no longer true, and the Angular team says:
There are no current plans to remove params
or queryParams
and there's no benefit to advising against their use.
Obsolete answer
According to the documentation :
Two older properties are still available. They are less capable than their replacements, discouraged, and may be deprecated in a future Angular version.
params — An Observable that contains the required and optional parameters specific to the route. Use paramMap instead.
Simple and efficient !
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…