我新手在角JS,我需要通過下面的代碼擊潰擊潰,但它得到HTTP狀態404錯誤如何通過角JS
Web控制檯顯示此消息
本地主機:8080/testasd /傳遞addStudent無法加載資源:服務器與404狀態響應(未找到)
var mainApp = angular.module("mainApp", ['ngRoute']);
mainApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/addStudent', {
templateUrl: 'AddStudent.html',
controller: 'AddStudentController'
}).
when('/viewStudents', {
templateUrl: 'ViewStudents.html',
controller: 'ViewStudentsController'
}).
otherwise({
redirectTo: '/addStudent'
});
}]);
mainApp.controller('AddStudentController', function($scope) {
$scope.message = "This page will be used to display add student form";
});
mainApp.controller('ViewStudentsController', function($scope) {
$scope.message = "This page will be used to display all the students";
});
你想它去到本地主機:8080/testasd/addStudent或localhost:8080/addStudent? –