简体   繁体   中英

How to connect Aurelia to Firebase?

Is fbh-firebase-util compatible with aurelia?

How to use it?

fbh-firebase-util via jspm:

jspm install github:djindjic/fbh-firebase-util

Aurelia is just a javascript framework. Aurelia itself won't keep you from using the libraries you love. After installing a library with jspm, just import it and use it. The only trick is knowing what the library exports, but the library should provide you with some documentation.

In all likelihood, you will just need to add this line at the top of your code which uses firebase:

import firebase from 'github:djindjic/fbh-firebase-util'

If you add a dependency to your package.json

"jspm": {
    "dependencies": {
      "firebase": "github:djindjic/fbh-firebase-util@^0.1.22",

then your import line becomes

import firebase from 'firebase'

If this doesn't immediately work, please review the firebase documentation to see what the module exports. The above assumes it exports default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM