2014-04-03 2 views
0

EmberJS를 사용하여 TodoMVC를 다시 작성했으며 완료 한 후 ApplicationAdapter를 FirebaseAdapter로 변경하려고했습니다. 그러나 응용 프로그램이 정지 작업과 나는이 오류가 무엇입니까 : 여기경로를로드하는 중 오류가 발생했습니다 : Firebase (emberFire)와 함께 EmberJS를 사용하는 동안 정의되지 않았습니다.

Error while loading route: undefined 

난 당신이 여기 github 에서 코드를 체크 아웃 할 수 있지만,

Ember  : 1.5.0 
Ember Data : 1.0.0-beta.7+canary.b45e23ba 
Handlebars : 1.3.0 
jQuery  : 2.1.0 

을 사용하고있는 버전에있는 파일 중 일부입니다 내용.

이 코드

, 그것은

Todos.ApplicationAdapter = DS.FixtureAdapter.extend(); 

작동하지만이로 변경하면 작업을 중지하고 나는 오류 얻을 :

Todos.ApplicationAdapter = DS.FirebaseAdapter.extend({ 
    firebase: new Firebase('https://glaring-fire-8506.firebaseio.com') 
}); 

나는 TodosController 및 TodoController를 가지고 있고,이 내 라우터 파일입니다

Todos.Router.map(function() { 
    this.resource('todos', { path: '/' }, function() { 
     this.route('active'); 
     this.route('completed'); 
    }); 
}); 

Todos.TodosRoute = Ember.Route.extend({ 
    model: function() { 
     return this.store.find('todo'); 
    } 
}); 

Todos.TodosIndexRoute = Ember.Route.extend({ 
    model: function() { 
     return this.modelFor('todos'); 
    }, 

    renderTemplate: function (controller) { 
     this.render('todos/index', { 
      controller: controller 
     }); 
    } 
}); 

Todos.TodosActiveRoute = Todos.TodosIndexRoute.extend({ 
    model: function() { 
     return this.store.filter('todo', function (todo) { 
      return !todo.get('isCompleted'); 
     }); 
    } 
}); 

Todos.TodosCompletedRoute = Todos.TodosIndexRoute.extend({ 
    model: function() { 
     return this.store.filter('todo', function (todo) { 
      return todo.get('isCompleted'); 
     }); 
    } 
}); 

EDIT : Firedbase에 todos JSON 개체를 추가했을 때 wor이었습니다. 그것이해야하는대로 왕. 그러나 나는이 문제를 정말로 알고 싶다.

+0

안녕 미르코, 당신은 오류를 재현 코드의 작은 샘플을 게시 할 수 있습니까? 좋은 예의 예일 뿐이지요. 다른 사람들에게 앱을 복제/빌드/학습/문제 해결하도록 요청하는 대신 작은 샘플로 좁히기위한 적절한주의를 기울입니다. 수정 사항을 수정하고 더 이상 오류를 재현 할 수 없을 때 변경 될 수 있습니다. . – Kato

+0

@Kato 또한이 문제가 있습니다. 다음은 최소한의 jsbin입니다. http://emberjs.jsbin.com/kuyujohi/14/edit?js –

+0

더 명확하게하기 위해 별도의 질문을 만들었습니다. –

답변

0

EmberFire가 비어 있거나 존재하지 않는 컬렉션을 전달하지 못하는 문제가있었습니다. 이것은 이제 emberFire repo에서 수정되었습니다.

Github의 문제 : https://github.com/firebase/emberFire/issues/39

관련 문제