Product Management Module
create new component
add router in app.module.ts
input add on (bootstrap)
firebase db service
Create service component
>ng g s service/category
Add service as provide in app.module.ts
Inject AngularFireDatabase and retrieve data
Inject service to component and link result observable
Save Form to DB
Input FormsModule for ngModel in each input field
implement save function in ts file
add new Service need add provider
Using AngularFireDatabase this.db.list('').push(product)
Validation
required validation
need bind variable with ngModel
add 'required' attribute
add div with bootstrap class 'alert alert-danger'
using ngIf to determine show or not show
custome validation library
npm i ng2-validation --save
Last updated
Was this helpful?