Push不是函数Angularjs错误

时间:2015-04-29 07:56:14

标签: angularjs

$scope.post1 = angular.fromJson(window.localStorage['like'] || '{}');

  var like ={
    id:''+id
  };
  $scope.post1.push(like);

window.localStorage['like'] = angular.toJson( $scope.post1);

当我运行此代码时,它会提供 $ scope.post1.push不是函数。。如何解决此问题?

0 个答案:

没有答案