我新手在角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? –