2
通過使用普通的JavaScript,我可以使用火力存儲像下面在AngularFire中,我們如何獲得像普通JavaScript那樣的存儲引用?
var config = {
apiKey: "AIzaSyCJ3RdrcdO_Zph5DKPN-RLmJsR5fBD7S5w",
authDomain: "myapp-90faa.firebaseapp.com",
databaseURL: "https://myapp-90faa.firebaseio.com",
storageBucket: "myapp-90faa.appspot.com",
};
firebase.initializeApp(config);
// file from some event e
var file = e.target.files[0];
var storage = firebase.storage().ref('images/'+file.name);
var task = storage.put(file);
但如何代碼才達到在角火存儲對象?在這裏我只是指一個數據庫:
var myApp = angular.module('myApp', ['firebase']);
var myProducts = new Firebase('https://myapp-90faa.firebaseio.com/products');
myApp.controller('ProductsCtrl', ['$scope', '$firebaseArray', function($scope,$firebaseArray) {
Firebase存儲尚未包裝在AngularFire 2.x中。看到這個[Github問題跟蹤其進展](https://github.com/firebase/angularfire/issues/785)。 –