Ich bin wirklich neu in der Entwicklung. Ich lerne AngularJS.Yeoman AngularJS Generator Problem mit jeder Route
Ich habe ein Problem mit yo eckig. Es erzeugt die App, grunt serve läuft lokal. Aber wenn ich auf den About-Button klicke geht es nicht über Seite
Hier ist ein Code (diese werden von Winkelgenerator generiert).
index.html
div class="collapse navbar-collapse" id="js-navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#/">Home</a></li>
<li><a ng-href="#/about">About</a></li>
<li><a ng-href="#/">Contact</a></li>
</ul>
</div>
</div>
</div>
</div>
app.js (von Skript-Ordner)
'use strict';
angular
.module('coolAppApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
controllerAs: 'main'
})
.when('/about', {
templateUrl: 'views/about.html',
controller: 'AboutCtrl',
controllerAs: 'about'
})
.otherwise({
redirectTo: '/'
});
});
Kennen Sie einen Teil des Codes, der das Problem verursacht? –
Ich gehe davon aus ** wenn. ('/ About', { templateUrl: 'views/about.html', Controller: 'AboutCtrl', controllerAs: 'über' }) ** –
die Lösung gefunden @ABusyProgrammer –