2016-05-08 6 views
1

フォームをfirebaseに送信する際に問題があります。 Iveは、さまざまなイベントリスナーとその関数を呼び出す方法を試してみましたが、データをfirebaseに取得できません。ここで私はcurrnetlyシンプルフォーム送信角度&Firebase

var firebaseRef = new Firebase("https://site.firebaseio.com/things"); 
var postRef = firebaseRef.push(); 

$scope.submitPost = function(){ 
    firebaseRef.push = ({Title: $scope.title, Description: $scope.moreinfo, Email: $scope.email, Number: $scope.number, Date: $scope.rtime}); 
    console.log('dome'); 
}; 

HTML

//divs all look like this for different inputs 

<div class="form-group"> 
    <label for="phone">Phone Number</label> 
    <input id="phone" ng-model="phone" 
    type="text> 
</div> 

+0

は角ではありません。さらに、jQueryのデザインが完全にオフになっているのは、それがうまくいかない理由です。 ngModelとngClickを使用して正しく実行してください。あなたのアプリを気にするなら、jQueryを削除してください。 – dfsq

+0

角度コードはどこですか?角張った形ではありません。 –

+0

@MohaiminMoin、私はそれを更新しました、あなたの考えを教えてください!感謝 ' –

答えて

0

pushを提出しなければならないものであることは、署名を持つ関数である:

push() - push([value], [onComplete]) 
Generates a new child location using a unique key and returns a Firebase reference to it. 

はこちらのマニュアルを参照してください。 https://www.firebase.com/docs/web/api/firebase/push.html

何をやっているの使用例

var messageListRef = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list'); 
    messageListRef.push({ 'user_id': 'fred', 'text': 'Yabba Dabba Doo!' }); 
// Same effect as the previous example, but we've combined the push() and the set(). 
関連する問題