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.'); }
Uncategorized
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
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
Understanding Angular Versioning
Angualr js is angular 1 is angular js after that in 2016 angular 2 is introduced which is complete change of angular js or complete re-write. angular 3 is skipped after that every six month angular version is updated with small.incremental,backwards-compatible changes. Now currently angular 9 is running. Angular 9 is basically same as angular 2. and also angular 10 will be same with slightly change.