This project was generated with Angular CLI version 8.3.23.
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.
This is the rules, that should be followed as you write the code in this project. They're not particularly strict, but it would be very nice to follow them as much as you could.
TODOs should be written in this pattern: todo:%firstName%.%lastName%:%date% - %todoContent%
E.g.:
todo:igor.vinogradov:25.02.2020 - this is an example todo
This ensures that developers who will be going through your code, will know when, by who and why this TODO was left and if it's still valid.
Since TypeScript doesn't allow accessing private methods outside of the class, underscoring them is not necessary. Please don't do it.
For easier code readability every variable, that contains boolean value should be prefixed with "b" (e.g.: bLoading or bAccessAllowed).
Every method that returns a boolean value should be prefixed with "is" (e.g.: isLoggedIn, isAdmin).
Every variable that contains something related to RxJS or NgRX should be postfixed with "$". That also includes all the selectors for store.
E.g.: bLoading$ - selector for Store, private store$: Store<any> - injecting Store in a component, private onDestroy$: Subject<void> - creating Subject for onDestroy event.
src/app/modules folder ng g m %pageName% --routing=true where %pageName% is the name of the new page (e.g. Login) - new folder %pageName% should be created, containing module declaration file and routing module declaration fileng g c %pageName%. %pageName% should be the same as created module name. This will create main component for created page module in the root folder of the module. path: '')routes const in src/app-routing.module.ts fileAs you need to create new components or file types (services, enums, etc), you need to create new folders named accordingly (components, enums, services, etc).
src/app/modules/%module%/%fileType%%module% - the module where you want to put your file or component%fileType% - type of the file you want to create (e.g. components if you want to create component, enums if you want to create enum, etc). If no folder is created for desired file type - create oneng g %schematic% [--options].--help option (ng g component --help)Before creating features or actions you need to initialize Store state for a module.
store. If this folder is already created - state has been already initialized and no need to do it again - this section.ng g store %moduleName% --module %pathToModule%%moduleName% - name of the module for which you want to initialize state.%pathToModule% - relative path to the module declaration file (e.g.: ..\home.module.ts).Feature contains reducers, actions, etc for a new piece of Store state.
NOTE: If you're not planning on creating new Store state part and want just to create actions or effects for manipulating already existing state refer to sections of creating Actions or Effects separately.
store folder. If none exists - refer to Initializing Store state for a module section.ng g feature %featureName% --module %pathToModule% --reducers %pathToReducers%%featureName% - the name of new feature.%pathToModule% - relative path to module where are you creating new feature (e.g.: ..\home.module.ts).%pathToReducers% - relative path to index.ts file located in reducers folderfeature.StoreModule.forFeature line created by the generator. It should contain something like for%featureName%.import that contains something like for%featureName% store/actions directory.reducers and effects files contains invalid import for actions which will need to be corrected before writing any reducers or effects. store/actions folder. If actions folder is not present - create one.ng g action %actionName%.%actionName% - name of the action you want to create.The structure of action file is a bit different from what NgRX devs propose, since I (Igor Vinogradov) think that my approach is much more structurized and clean, steps below are necessary before using actions file.
Ctrl+A then Delete or Backspace).src/app/modules/shared/store/actions/example.actions.ts fileexample.actions.ts file to the file you are preparing to use.example.actions.ts file contains rough structure of actions file that should be used in the project.ExampleActions. (e.g. UserActions)Actions file is ready to use.
TODO
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.