私はブートストラップ、angularjsを使ってWebアプリケーションを開発しました。私はページ間をルーティングするためにrouteproviderを使用しました。 Visual Studioを使用してデバッグしたときにアプリが正常に動作していました。アプリケーションは正常に動作しており、ページ間を移動することができます。しかし、ローカルマシンからindex.htmlをロードすると、file:///C:/Users/index.html
スクリプトファイルはロードされず、何も動作しません。私はcordovaを使ってこのwebappをモバイルアプリにデプロイする必要があります。 ありがとうございます。 browsers
の限界だローカルマシンからロードされたときにRouteProviderが動作しない
script.js
app.config(['$routeProvider', '$httpProvider','$compileProvider','$locationProvider', function ($routeProvider, $httpProvider, $compileProvider,$locationProvider) {
$routeProvider.
when('/web', { /* Route provider with masterpage and templates*/
templateUrl: 'templates/web.html',
controller: 'webctrl'
}).
when('/login', {
templateUrl: 'templates/login.html',
controller: 'webctrl'
}).
when('/register', {
templateUrl: 'templates/register.html',
controller: 'webctrl'
}).
when('/account', {
templateUrl: 'templates/account.html',
controller: 'accountctrl'
}).
when('/share', {
templateUrl: 'templates/share.html',
controller: 'sharectrl'
otherwise({
redirectTo: '/web'
});
$locationProvider.html5Mode(true);
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/);
}]);
コードバスに展開する際にこの制限を取り除く方法 – Alan