I'm trying to build a ng2 app with angularfire. Following the quickstart, I receive the following error:
cannot find namespace 'firebase'
Seems to be something with the typings, installed all of them though. Any ideas on this issue?
If you have a fresh angular 2.0 CLI project - this will work - i don't know your particular setup:
tsconfig.json
looks like this: "compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types" /// - here - types are pointing to this @types folder inside node_modules.
]
}
@types
called firebase
.firebase
, name it index.d.ts
index.d.ts
It looks like the recommended way to add typing's to an Angular 2.0 CLI project - is to add them inside node_modules/@types folder.. As you can see the jasmine typing's folder looks similar - and was automatically added there by the CLI scaffolding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With