- @see Firebase CMS issue tracker.
- Add more tests on user register with wrong email format and more.
- To see an Angular sample app that is using
Firebase CMS
. In fact, we use this app to buildFirebase CMS
.
-
It is very convinient to develop Firebase CMS as a submodule. You can update it while building a Project. and you can
npm publish
when ever you want to update the version ofFirebase CMS
. -
First add
Firebase CMS
submodule to a project.
$ git submodule add https://github.com/thruthesky/firebase-cms src/app/modules/firebase-cms
- Install dependencies
$ npm i lodash
$ npm i @types/lodash -S
$ npm i firebase angularfire2
$ npm i ng-packagr -D
- Then open the app module and add the following.
import { environment } from '../environments/environment'; // You need to save firebase configuration in environment.ts
import { FirebaseCmsModule, FirebaseCmsService } from './modules/firebase-cms/firebase-cms.module';
@NgModule({
imports: [
FirebaseCmsModule
]
})
export class AppModule {
constructor(cms: FirebaseCmsService) {
cms.initializeFirebase(environment.firebase);
}
}
-
If you want to publish update version of
Firebase CMS
as node module, please follow the instructions of Ng-Packagr -
Update below in parent project's
package.json
. ( Not in firebase-cms/package.json )
{
"name": "firebase-cms",
"version": "0.2.12",
"scripts": {
"pack": "ng-packagr -p package.json"
},
"private": false,
"ngPackage": {
"lib": {
"entryFile": "public_api.ts"
}
}
}
- save below modules you want to export in
public_api.ts
export * from './src/app/modules/firebase-cms/sdk';
export * from './src/app/modules/firebase-cms/components';
export * from './src/app/modules/firebase-cms/unit-tests';
-
compile with
npm run pack
-
distribute with
npm publish dist
- @see Backend README.md
- We have a unit-test on client side to test the client sdk.
Simple inject the
UnitTest
serivce.
constructor( unitTest: UnitTest ) {}
- Error will be thrown all the time if there is any error on sdk.
For instance, if router is missing, a Promise error is thrown and it is catchable with .catch() { ... }