콜백에서 이것을 반환하려했지만 항상 정의되지 않습니다. 여기 javascript chainning이 콜백에서 이것을 반환합니다.
는create: function(currentView, data){
var itsMe = this;
this.thumbsWrapper = this.templates.wrapper().hide();
currentView.append(this.thumbsWrapper);
this.thumbsWrapper.fadeIn("fast", function(){
return itsMe;
});
},
var l = list().create(currentView); //need teh return that i can use chaining
var에 리터를 냈다입니다 지금 정의되지 않은, 나는 그것이 OBJ
에게 반환하는 콜백 fadeIn를 사용 해달라고하면 콜백 ... 로 fadeIn를 사용하는 경우 누구 아이디어? @Felix 클링가 올바른지 뭐라고, 당신은 아무것도 반환하지 않습니다
create: function(currentView, data){
var itsMe = this;
this.thumbsWrapper = this.templates.wrapper().hide();
currentView.append(this.thumbsWrapper);
this.thumbsWrapper.fadeIn("fast", function(){
return itsMe; //<--- this isn't going anywhere because you don't capture it
});
return itsMe; //<------ return the object
},
콜백은 호출 된 곳의 값을 반환하기 때문에'.fadeIn' 내부에 있습니다. 'create' 함수에는 아무런 영향을 미치지 않습니다. –