Firebase storage and angularfire2

后端 未结 2 1981
南笙
南笙 2021-01-03 13:11

How do to get the images from Fire base storage using angular fire 2. Thanks a lot!

constructor(public af: AngularFire) {
this.items = af.database.list(\'/me         


        
2条回答
  •  [愿得一人]
    2021-01-03 13:49

    Right now there isn't an official integration with AngularFire2 and Firebase Storage. However, it's quite easy to use the regular SDK.

    @Component({
    
    })
    class MyComponent {
      image: string;
      constructor() {
        const storageRef = firebase.storage().ref().child('path/image.png');
        storageRef.getDownloadURL().then(url => this.image = url);
      }
    }
    

    Then in your template

    
    

提交回复
热议问题