Im trying to learn Angular and the video tutorial I am doing is using Firebase, Ive got Firebase defined as
//Contacts controller
.controller('ContactsCtrl', ['$scope', '$firebaseArray', function($scope, $firebaseArray) {
//init firebase
var ref = new Firebase('https://myappurl-048596.firebaseio.com/');
but when viewing the console, I keep getting errors saying Firebase not defined and it breaks the whole project. So, how do I properly define Firebase so that I can get rid of this error?
Follow this link: https://firebase.google.com/docs/web/setup
Add this in your config function:
var firebaseConfig = { apiKey: "<API_KEY>", authDomain: "<PROJECT_ID>.firebaseapp.com", databaseURL: "https://<DATABASE_NAME>.firebaseio.com", storageBucket: "<BUCKET>.appspot.com", messagingSenderId: "<SENDER_ID>", }; firebase.initializeApp(firebaseConfig);
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.