1
変更するには、$locationProviderからこれを変更することができ角度のjのURLフォーマットを#から#に変更してください。
http://example.com/#!/alphabits/a_b_c
どれ提案
変更するには、$locationProviderからこれを変更することができ角度のjのURLフォーマットを#から#に変更してください。
http://example.com/#!/alphabits/a_b_c
どれ提案
に以下の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: '/'
});
}]);
http://stackoverflow.com/questions/40478676/i-am-using-angular-and-my-url-always-has-a-exclamation-mark/40478862 – jbalgue