2016-12-01 5 views

答えて

2

に以下のURL

http://example.com/#/alphabits/a bはC

。私はこれを変更するために私のアプリケーションでこのコードを使用しました。

angular.module('myApp').config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { 
$locationProvider.hashPrefix(''); // We are actually removing ! from URLs as ! is default one. 
$routeProvider 
    .when('/', { 
     templateUrl: 'templates/home.tpl.html', 
     controller: 'homeCtrl' 
    }) 
    .when('/about', { 
     templateUrl: 'templates/about.tpl.html', 
     controller: 'aboutCtrl' 
    }) 
    .otherwise({ 
     redirectTo: '/' 
    }); 

    }]); 
関連する問題