1
코드입니다 :
$routeProvider.when('/devices-list', {
templateUrl: 'Views/Layouts/devices-list.html',
controller: 'deviceLibraryController'
});
그러나 나는 그렇게 바로 가기를 갖고 싶어.
$routeProvider.when('/devices-list', {
templateUrl: 'Views/Layouts' + this.path +'.html', // where this.path would be '/device-list'
controller: 'deviceLibraryController'
});
이렇게 비슷한 단계가 있습니까?
업데이트 : 내가 거기 $routeProvider.when('/:name', {...})
와 비슷한 상황을하는 한 가지 방법이지만 변수 방법으로 모든 :name
을 구문 분석 발견
. 필요한 것은 경로가 이미 지정되어 있으며 $ routeProvider에서 경로를 검색하여 templateURL을 반환합니다.
the reference에 명시된 바와 같이