반응형

환경 : angularJS 1.6, gulp


JSON.stringify(Json 데이터);

를 사용하면 error(실제로는 warning)이 뜨는 경우

error       You should use the toJson method instead of JSON.stringify

다음과 같이 변경한다.

angular.toJson(Json 데이터);


[출처] https://docs.angularjs.org/api/ng/function/angular.toJson


JSON.parse(Json 데이터);

를 사용하면 error(실제로는 warning)이 뜨는 경우

error       You should use the fromJson method instead of JSON.parse

다음과 같이 변경한다.

angular.fromJson(Json 데이터);


[출처] https://docs.angularjs.org/api/ng/function/angular.fromJson

반응형

+ Recent posts