我的http-server没有获取对html的更改?

时间:2015-11-12 06:36:19

标签: angularjs firebase httpserver simplehttpserver

当我更新我的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模板没有显示

1 个答案:

答案 0 :(得分:1)

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