Попытка подключить шаблон AngularJS к firebase, но не может решить проблему.
Я уже npm установил все, что мог, включая наборы, angularfire, firebase и еще несколько.
Вот мой app.component.ts:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
template: '<router-outlet></router-outlet>',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
title = 'app';
ngOnInit() {
const config = {
apiKey: "AIzaSyBKOJjrzrgT0rXZxonOgk8qM-OIlUjJA4I",
authDomain: "tn-test-0001.firebaseapp.com",
databaseURL: "https://tn-test-0001.firebaseio.com",
projectId: "tn-test-0001",
storageBucket: "tn-test-0001.appspot.com",
messagingSenderId: "564114143143"
};
firebase.initializeApp(config);
}
}
Вот мой package.json:
"private": true,
"dependencies": {
'''
"angular-tree-component": "^7.0.2",
"angular2-text-mask": "^8.0.4",
"angularfire2": "5.0.0-rc.4",
"classlist.js": "^1.1.20150312",
"core-js": "^2.4.1",
"d3": "^3.5.17",
"echarts": "^4.0.4",
"firebase": "^4.3.0",
"hammerjs": "^2.0.8",
"https": "^1.0.0",
"imagesloaded": "^4.1.4",
"isotope-layout": "^3.0.6",
"mandrill-api": "^1.0.45",
"masonry-layout": "^4.2.1",
"moment": "^2.18.1",
"ng-scrollreveal": "^2.2.0",
"ngx-bootstrap": "^2.0.5",
"ngx-echarts": "^3.1.0",
"ngx-filter-pipe": "^2.1.0",
"ngx-isotope": "^0.1.7",
"ngx-nvd3": "^1.0.9",
"ngx-perfect-scrollbar": "^5.3.5",
"ngx-quill": "^2.1.2",
"ngx-swiper-wrapper": "^6.0.0",
"rickshaw": "^1.6.5",
"rxjs": "^6.0.0",
"rxjs-compat": "^6.4.0",
"scrollreveal": "^3.3.6",
"text-mask-addons": "^3.7.1",
"web-animations-js": "^2.3.1",
"zone.js": "0.8.26"
},
Ошибка, которую я получаю в терминале:
ОШИБКА в файле src / app / app.component.ts (20,5): ошибка TS2304: не удается найти имя 'firebase'.
Я перепробовал все, что нашел в Интернете до сих пор, и кажется, что ничего не работает. Я предполагаю, что это какое-то простое решение, но я не могу его найти. Пожалуйста, дайте мне знать, какая другая информация / код вам может понадобиться.