카테고리 없음

[자바 스크립트] 백본 : Uncaught TypeError : 정의되지 않은 '각'메서드를 호출 할 수 없습니다.

행복을전해요 2021. 2. 9. 06:35

다음은 코드 의 작동 jsfiddle 입니다.

컬렉션보기가 손상되었습니다. 다음은 작동 버전입니다.

//collection view
// Notice that it's a `Backbone.View` and not a `Backbone.Collection`
App.Views.Tasks = Backbone.View.extend({

    tagName : 'ul',
    
        initialize : function(){this.render();},
        
            render : function(){
            
                    this.collection.each(function(t){
                    
                                var v = new App.Views.Task({model : t});       
                                
                                            this.$el.append(v.render().el);
                                            
                                                    }, this); // scope to the view using `this`
                                                    
                                                        }
                                                        
                                                        });
                                                        


출처
https://stackoverflow.com/questions/22050347