0
$routeProvider.when('/home', {
    templateUrl: 'index.php/projects/projects/contact',
    controller: 'home'
});

$routeProvider.otherwise({ redirectTo: '/home' });

templateUrl を取得して正しい URL を取得できないようです。/home にのみリダイレクトされるようです。私が間違っていることを誰かが知っていますか?

4

2 に答える 2

0

あなたの呼び出しパス、、index.php/projects/projects/contactが間違っている可能性があります。を使用するだけprojects/projects/contact/index.phpです。

$routeProvider2 回呼び出す代わりに、コードを次のように簡略化することもできます。

$routeProvider.
when('/home', {
    templateUrl: 'projects/projects/contact/index.php',
    controller: 'home'
}).
otherwise({
    redirectTo: '/home'
})
于 2014-11-13T15:09:42.727 に答える