我的http服务器没有接收到对html的修改?

问题描述 投票:1回答:1

当我更新我的html时,没有接收到变化(使用http-server)。我重启服务器,修改html,修改app.js,但除非我等一会儿,否则没有任何反映。有什么原因吗?这是个小程序......好困惑啊

package.json

{
  "name": "Music_2.0",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "http-server": "^0.8.5"
  }
}

app.js

var app = angular.module('launchPage', ["ui.router","firebase"]);


app.config([
'$stateProvider',
'$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {

  $stateProvider
    .state('home', {
      url: '/home',
      templateUrl: 'home.html',
      controller: 'FirstCtrl'
    })
  .state('year', {
  url: '/year/{year}',
  templateUrl: 'music.html',
  controller: 'FirstCtrl'
});

  $urlRouterProvider.otherwise('home');
}]);

app.factory('years', [function(){
var o = {

years:  ['1999'] 

}
return o; 

}]);  

app.controller('FirstCtrl', [
'$scope',
'years',
'$firebaseObject',
'$stateParams',
function($scope, years, $firebaseObject, $stateParams){

var ref = new Firebase("https://musicapp11.firebaseio.com/");

  $scope.test = 'Music App';
  $scope.years = years.years;
  $scope.data = $firebaseObject(ref);

  var syncObject = $firebaseObject(ref);

  syncObject.$bindTo($scope, "data");

  $scope.addYear = function (){
    $scope.years.push($scope.year); 
    $scope.year = ""; 

    }
}

]);

然后明显有两个html模板没有显示

angularjs firebase httpserver simplehttpserver
1个回答
1
投票

我猜我的浏览器在缓存。我不知道为什么它会这样做。它从来没有这样做,但我检查了一个框,现在它是正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.