Hallo, ich habe ein Problem mit meinem Code. Wenn ich auf die Link-Seite klicke, wird sie nicht neu geladen.Verwenden von TemplateUrl funktioniert nicht
ist hier ein HTML und JS-Code:
var app=angular.module('mainApp',['ngRoute']);
app.config(function($routeProvider){
$routeProvider
.when('/',{
templateUrl: 'home.html'
})
.when('/about',{
templateUrl: 'about.html'
});
\t \t .when('/contact',{
templateUrl: 'contact.html'
});
\t \t .otherwise({ redirectTo: '/'});
});
app.controller('mainCtrl',function($scope){
\t
});
<div ng-controller="mainCtrl">
\t \t <div>
\t \t \t <nav>
\t \t \t \t <ul>
\t \t \t \t \t <li><a href="#/">Home</a></li>
\t \t \t \t \t <li><a href="#/about">About us</a></li>
\t \t \t \t \t <li><a href="#/contact">Contact</a></li>
\t \t \t \t </ul>
\t \t \t </nav>
\t \t </div>
\t <br/>
\t \t <div ng-view >
\t \t
\t \t </div>
</div>
Haben Sie eine Ahnung, was `s falsch?
Sie versuchen, auf '.when' off ein Trennzeichen'; ' –
entfernen Semikolon nach, wenn() –
wenn ich löschen; vorher .wenn nichts geändert wird – Ernest