2012-06-06 2 views
1

내 Ember 앱은 임의의 사용자 데이터 (북마크 생각하기) 외에 상당한 양의 공통 데이터 (교과서 생각)를 기반으로합니다. 조명기에서 공통 데이터를로드하려고하고, 결국 ember-data의 REST 어댑터 (사용자 데이터 용)와 조명기 어댑터 (일반 데이터 용)를 사용하는 두 개의 데이터 저장소를 만들었습니다.ember-data가 내 조명기를로드하지 않는 이유는 무엇입니까?

그러나 조명기 어댑터는 조명기 데이터를로드하지 않습니다. This jsfiddle은 내가하려고하는 것의 최소한의 것입니다 : 그것은 앱, 모델, 그 모델의 조명기, 조명기 어댑터를 사용하는 상점, 그리고 그 콘텐트를 가져 오는 (또는 얻으려고하는) 컨트롤러를 정의합니다. 가게. 그러나 그것은 ... 아무것도 얻지 못합니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까? 문제가 Sylvius.sectionController의 'content 정의의 semicolon처럼

Sylvius = Ember.Application.create(); 

Sylvius.Section = DS.Model.extend({ 
    // e.g. Surface, Sectional, Pathways, Visual Glossary 
    title: DS.attr('string') 
}); 

Sylvius.Section.FIXTURES = [{ 
    "id": 1, 
    "title": "Surface Anatomy" 
}, { 
    "id": 2, 
    "title": "Sectional Anatomy" 
}, { 
    "id": 3, 
    "title": "Pathways" 
}, { 
    "id": 4, 
    "title": "Visual Glossary" 
}]; 

Sylvius.fixtureStore = DS.Store.create({ 
    revision: 4, 
    adapter: DS.fixtureAdapter 
}); 

Sylvius.sectionController = Em.ArrayController.create({ 
    content: Sylvius.fixtureStore.findAll(Sylvius.Section); 
}); 

답변

2

는 것 같습니다. 삭제하면 작동합니다 (http://jsfiddle.net/pangratz666/Kpdqd/ 참조) :

... 

Sylvius.sectionController = Em.ArrayController.create({ 
    content: Sylvius.fixtureStore.findAll(Sylvius.Section) 
}); 
+0

그랬습니까? 그 작업을 통해 응용 프로그램 코드의 어느 부분이 전체 응용 프로그램에서 가져 오기를 위반했는지 알 때까지 필자는 코드를 다시 바이올린에 추가 할 수있었습니다. – pjmorse

관련 문제