Reputation: 490
Here what i have done in my service.ts
import * as firebase from 'firebase/app';
getRetuarantImageformStorage(res, hotelName) {
this.storageRef = firebase.storage().ref().child('Restaurants/' + this.emailToKey(res.email) + '/' + hotelName);
return this.storageRef.getDownloadURL();
}
This how i called for the method inside my component
this.dataservice.getRetuarantImageformStorage("[email protected]", "shangri la");
I have manually uploaded the image to the above given path in the firebase storage
But i have got this error
ERROR TypeError: __WEBPACK_IMPORTED_MODULE_1_firebase_app__.storage is not a function
at handleDataService.webpackJsonp.38.handleDataService.getRetuarantImageformStorage (handleData.service.ts:105)
at Restaurants.ts:24
at Array.forEach (<anonymous>)
at SafeSubscriber._next (Restaurants.ts:23)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
at SafeSubscriber.next (Subscriber.js:185)
at Subscriber._next (Subscriber.js:125)
at Subscriber.next (Subscriber.js:89)
at MapSubscriber._next (map.js:83)
at MapSubscriber.Subscriber.next (Subscriber.js:89)
I have searched for a clear documentation for this, but i haven't got any satisfied answer.
Upvotes: 0
Views: 660
Reputation: 26
I changed: import * as firebase from 'firebase/app';
to: import * as firebase from 'firebase';
Upvotes: 1