to $routeProvider or $stateProvider

前端 未结 2 1580
误落风尘
误落风尘 2021-02-03 20:12

I have been looking for a sound answer to to this dilema, to routeProvider or not to.

It appears as if $routeProvider is soon going to be discontinued and replace with $

2条回答
  •  轮回少年
    2021-02-03 21:00

    We started with $routeProvider and moved to $stateProvider to leverage some of the features that ui-router provides. When we moved the migration was absolutely trivial. Having said that, ui-router is still very early (from their GitHub page):

    Warning: UI-Router is pre-beta and under active development. As such, while this library is well-tested, the API is subject to change. Using it in a project that requires guaranteed stability is not recommended.

    Stick with $routeProvider until you decide you need something else. Until then, make sure you are getting good test coverage so that shifts like that aren't too big of a concern.

提交回复
热议问题