-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (22 loc) · 863 Bytes
/
app.js
File metadata and controls
27 lines (22 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const ul = document.querySelector('.movie-list')
var firebaseConfig = {
apiKey: "AIzaSyCz6AxfXsi3VS8NTskj56mknA3JTM1b05w",
authDomain: "movies-e08f0.firebaseapp.com",
projectId: "movies-e08f0",
storageBucket: "movies-e08f0.appspot.com",
messagingSenderId: "640529872732",
appId: "1:640529872732:web:085019fcc33f860f503399",
measurementId: "G-H4QFTY3ZR8"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
//gettings data from firebase
const db = firebase.firestore();
db.collection('movies').get().then((snapshot) => {
snapshot.docs.forEach(doc => {
let movie = doc.data()
let movieItem = document.createElement('tr')
movieItem.textContent = movie.Rank + '. ' + movie.Name
ul.appendChild(movieItem)
})
})