Handling trailing slashes in angularUI router

后端 未结 6 698
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 06:59

It\'s been hours since I started working on this problem and I can\'t seem to get my head around the solution.

I have an app that may result in users actually typing

6条回答
  •  [愿得一人]
    2020-12-03 07:24

    urlMatcherFactoryProvider is deprecated for v1.x of angular-ui-router.

    Use urlService.config.strictMode (ng1, ng2) instead.

    It still needs to be before $stateProvider.state().

    myApp.config(function($stateProvider, $urlServiceProvider) {
      var homeState = {
        name: 'home',
        url: '/home',
        component: 'xyHome'
      };
    
      $urlServiceProvider.config.strictMode(false);
    
      $stateProvider.state(homeState);
    

    });

提交回复
热议问题