This project was generated with Angular CLI version 12.1.1.
Steps to create an Angular Project -
- ng new Phone-Book
- Add fontawesome to index.html
- Clear the app.component.html file and write Hello World for now
- Add CDN of BootStrap in index.html OR Install BootStrap & add styles and scripts to Angular.json
Bootstrap import => npm install --save bootstrap
jQuery import => npm install --save jquery@latest - Add json commands => npm install json-server || json-server --watch db.json
- Create component => (home, addContact) => ng g c
- Create service => Contact => ng g s Contact
- In service => import HttpClient => add get methods
- Add imports to app.module.ts => HttpClientModule, FormsModule, ReactiveFormsModule
- Work on home component => ts and html files
- Add this in tsconfig.json => "strictPropertyInitialization": false,
- Add routes in app-routing.module.ts. Check if routes are working.
- Add Delete Function
- Added editContact component and routes
- Added Sorting code
- Added Search box, install => npm i ng2-search-filter AND npm i ng2-filter-pipe
- In app.module.ts => import Ng2SearchPipeModule
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.