2017-10-21 5 views
0

emberfire는 : this._ref.push는 함수가 아닙니다

내가 emberfire 다음과 같은 오류가 발생하는 것 같다 문제는, 내가 여전히 오류 얻을 아직 문서를 다음

:

Uncaught TypeError: this._ref.push is not a function 
    at Class.generateIdForRecord (firebase.js:75) 
    at Class._generateId (-private.js:10359) 
    at Class.createRecord (-private.js:10325) 
    at Class.test (home.js:13) 
    at Class.send (action_handler.js:32) 
    at action.js:141 
    at exports.flaggedInstrument (ember-metal.js:3730) 
    at action.js:140 
    at Backburner.run (backburner.js:537) 
    at run (ember-metal.js:4267) 

을 다음 코드는 오류가 발생한 곳입니다. 코드는 단순히 home이라는 컨트롤러에있는 작업에 배치됩니다.

var newGlobal = this.store.createRecord('global', { 
    about: 'test', 
}); 
newGlobal.save(); 

데이터베이스의 규칙은 다음과 같습니다. 다음과 같이 설정하십시오 :

{ 
    "rules": { 
    ".read": true, 
    ".write": true 
    } 
} 

데이터베이스가 비어 있습니다.

나는 설정 config/environment.js

어떤 아이디어도 가지고하시기 바랍니다?

가 사전에 감사

유용한 링크

emberfire

Emberfire guide

Found these issues but they didn't help with my issue

답변

0

이 지금 해결, 문제는 내가 정의 엠버 서비스를 만들었다되었다 firebase.

그래서 같이 home 제어기에 주입했다 :

firebase: Ember.inject.service()