答えて

1

は、あなたがこれを試すことができます願っています。

let docRef = db.collection("following").doc("your-id"); 

docRef.get().then((doc)=> { 
    if (doc.exists) { 
     console.log("Document data:", doc.data()); 
     let myData=doc.data(); 
     let isTrue= myData.boolean-property-name;//return true or false 
     } else { 
     console.log("No such document!"); 
    } 
}).catch(function(error) { 
    console.log("Error getting document:", error); 
}); 

AngularFire2を使用する:Docs

注:

をこの記事を読む:Google Cloud Firestore integration with Ionic and AngularFire

your-id - あなたがここにあなたのdoc

を渡す必要があります

boolean-property-name - これは単なるダミーの名前です。ここにあなたの実際のプロパティ名を渡す必要があります。あなたの場合、そのようなcug.....

+0

こんにちは、ありがとうございました...私は指示されたコードを試しましたが、それは3つのエラーを返しましたが、印刷はリンクにあります:(https://drive.google。 com/open?id = 0B14jg18TLF3USC1xc292S3FYR0k) –

+0

アップデートを参照してください。 。 プロパティ「GET」タイプに存在しませんが、「<{}>をAngularFirestoreDocument」活字エラー ** – Sampath

+0

は、私は1つのだけエラーが出る今変更をしましたか? –

関連する問題