Cannot POST /index.html in AngularJS 本地主机错误,而在服务器上工作正常

Cannot POST /index.html in AngularJS error in localhost whereas works fine on server

我目前正在处理 AmgularJS 项目,当我在 Amazon 服务器上托管项目时,我在 Homeview 中成功登录,但它在本地主机上不起作用。

App.js 是这样的:

//Define an angular module for our app
var app = angular.module('blickbeeLite', [ 'ngRoute']);

app.controller('MainController', function($scope, $http)
{
});

app.config(['$provide', '$routeProvider', function ($provide, $routeProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/login.html',
      })
      .when('/:templateFile', {
        templateUrl: function (param) { return 'views/'+param.templateFile+'.html' }
      })
      .otherwise({
        redirectTo: '/'
      });
  }]);

错误是:

不能POST/index.html

你有没有在你的html中加入'angular-route.js'? 类似问题

Angular unknown provider and Cannot POST /signup