장고와 함께 백본을 사용하려고합니다. backbone-tastypie : 최대 호출 스택 크기가 초과되었습니다.
은 내가 먼저 todomvc에서 백본의 작업 지역의 예에 나섭니다 : https://github.com/addyosmani/todomvc/tree/master/architecture-examples/backbone내가 다음 로컬 스토리지 대신 서버를 사용하고 싶었다. 그래서 REST API를 위해 django-tastypie를 선택했습니다. 브라우저에서 REST 클라이언트 (우편 배달부)를 사용하여 REST API를 테스트했는데 제대로 작동합니다.
다음은 todomvc 예제로 작동하게하고 싶습니다. 로컬 저장소가 아닌 서버를 사용하기 위해 몇 가지 사항을 설정했습니다. 모두가 권장하는대로 작은 변환 레이어 백본 -tastypie.js가 있습니다. 그러나 (https://github.com/PaulUithol/backbone-tastypie/blob/master/backbone_tastypie/static/js/backbone-tastypie.js)
, 나는 오류 RangeError를 얻을 : 최대 호출 스택의 크기가 때 초과 backbone-tastypie.js 레이어를 사용할 때 컬렉션에 fetch 메소드를 사용합니다.
아이디어가 있으십니까? 오류에
자세한 내용 : 자원에
a = window.App
a.Todos.fetch()
RangeError: Maximum call stack size exceeded
arguments: Array[0]
length: 0
__proto__: Array[0]
concat: function concat() { [native code] }
constructor: function Array() { [native code] }
every: function every() { [native code] }
filter: function filter() { [native code] }
forEach: function forEach() { [native code] }
indexOf: function indexOf() { [native code] }
join: function join() { [native code] }
lastIndexOf: function lastIndexOf() { [native code] }
length: 0
map: function map() { [native code] }
pop: function pop() { [native code] }
push: function push() { [native code] }
reduce: function reduce() { [native code] }
reduceRight: function reduceRight() { [native code] }
reverse: function reverse() { [native code] }
shift: function shift() { [native code] }
slice: function slice() { [native code] }
some: function some() { [native code] }
sort: function sort() { [native code] }
splice: function splice() { [native code] }
toLocaleString: function toLocaleString() { [native code] }
toString: function toString() { [native code] }
unshift: function unshift() { [native code] }
__proto__: Object
get message: function() { [native code] }
arguments: null
caller: null
length: 0
name: ""
prototype: Object
__proto__: function Empty() {}
set message: function() { [native code] }
arguments: null
caller: null
length: 1
name: ""
prototype: Object
__proto__: function Empty() {}
stack: undefined
type: "stack_overflow"
__proto__: Error
arguments: undefined
constructor: function RangeError() { [native code] }
name: "RangeError"
stack: undefined
type: undefined
__proto__: SetUpError.d
같은 코드의 어떤 것일까? 아마 어딘가에 숨어있는 무한 루프가있을 것입니다. –
아마도 Mu가 맞을 것입니다. 필자의 (제한된) tastypie 경험에서 최대 호출 스택 크기는 무한 루프의 결과를 초과했으며 종종 이것은 tastypie 코드에 내장 된 리소스를 채 웁니다. – bento
늦게 답변을 드려 죄송합니다. 인터넷에 더 이상 액세스 할 수 없었습니다. 실제로 todomvc의 백본 예제를 로컬 저장소 대신 서버를 사용하도록 조정하려고했습니다. https://github.com/addyosmani/todomvc/tree/master/architecture-examples/backbone – Michael