var index = this.indexOf(model); returns always -1 var index = this.models.indexOf(model) returns the right result