We can make the enumerations object immutable by using the freeze function const Direction = { north: 0, east: 1, south: 2, west: 3 }; Object.freeze(Direction); And to check that some object is freeze or not we use the frozen object. if (Object.isFrozen(Direction)){ console.log ('Direction is immutable.'); } else { console.log ('Direction is mutable.'); }
Setting Up Ngrx store with the Ngrx schematics
code to create the ruducers which includes StoreModeul in the app.module.ts is ng generate store AppState --root --module app.module.ts
Create action in particular folder creating auth action in auth folder
ng generate action auth/Auth
AngularPipe
There are several angular pipe the main task of pipe is to take data and transformed into the suitable form to show in the template this is done in html template there are several types of pipes like:
1. uppercase or lowercase
{{propertyName | uppercase |lowercase}}
2. datepipe like shortDate, short,shortTime
3. slice : this is to say that where to start the string and where to end to display the desired result.
5. number: this pipe is to show that how many number is should shown before decimal and after decimal.
6.percentage: this pipe is used to show the data to dispaly in percentage like data is .025 shows 25 percent if percentage pipe is used.
To create repository in github
This is the link so study steps in this link to create repository in github
Adding Bootstrap and JQuery in angular
For adding Bootstrap in angular there is already bootstap included in the angular 9 in node_modules folder. otherewise dowload using npm via folloing command npm install --save bootstrap
install JQuery vianpm install --save jquery
After the installation of the bootstrap and jquery we must have to include in our project.So for this go to the angular.json file and then paste in styles
“styles”:[ “./node_modules/bootstrap/dist/css/bootstrap.css” ]
“scripts”: [ “./node_modules/jquery/dist/jquery.js”, “./node_modules/bootstrap/dist/js/bootstrap.js”]
How to Kill the process of ng serve command which still used the port 4200 .
For Linux Users:sudo kill $(sudo lsof -t -i:4200)
Also u could try sudo kill `sudo lsof -t -i:4200`
For All Operating System go to https://stackoverflow.com/questions/39091735/port-4200-is-already-in-use-when-running-the-ng-serve-command