아니요,이 방법을 사용하면 문제가 없습니다. 당신은 당신이 당신의 경로를 정의하는 방법에있어서 신중해야합니다. 예를 들어
: /:username
모든 것을 일치하기 때문에 홈 경로가, 위의 예에서 호출되지 얻을 않습니다
$routeProvider.
when('/:username', {
templateUrl: 'templates/user.html',
controller: 'UserController'
}).
when('/home', {
templateUrl: 'templates/home.html',
controller: 'HomeController'
});
. 따라서 여러 경로가있는 경우 /:username
경로가 마지막으로 사용한 경로인지 확인해야합니다.
$routeProvider.
when('/home', {
templateUrl: 'templates/home.html',
controller: 'HomeController'
}).
when('/:username', {
templateUrl: 'templates/user.html',
controller: 'UserController'
});
"하지만 라우터에서 문제가 발생할 수 있다고 생각합니다." 또는 현재 어떤 문제가 있습니까? –