Home route in ui-router

后端 未结 4 1786
陌清茗
陌清茗 2021-02-13 18:11

I use https://github.com/angular-ui/ui-router library. When I try to access index route (\'/\') I\'m redirected to 404. The code:

angular.module(\'cr\').config(f         


        
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-13 18:49

    The simplest way for me with ui-router was giving the url field an empty value :

            $stateProvider
            .state('home', {
                url: '',
                templateUrl: 'views/homepage.html',
                controller: 'AppCtrl'
            })
    

提交回复
热议问题