0
var app = angular.module('app',['ngStorage']);
app.controller('myController', ['$scope','$localStorage', function($scope, $localStorage){
\t var comment = [
\t \t { \t name : '',
\t \t \t rating : ''
\t \t }
\t ]
\t $scope.saveData = function (review) {
\t \t comment.push(comment);
\t \t localStorage.setItem("review", JSON.stringify(comment));
\t \t console.log("dkfjhdjhgjh",review); \t
\t };
\t
}])
當我通過輸入框我得到類型錯誤插入。
輸入框在哪裏 – Sajeetharan
[Chrome sendrequest錯誤:TypeError:將循環結構轉換爲JSON]可能的重複(http://stackoverflow.com/questions/4816099/chrome-sendrequest-error-typeerror-converting-circular-結構到JSON) – Sajeetharan