Skip to main content

Posts

Showing posts with the label Angular Debugging

Frequent Errors / Fixes in Angular Development : Updated June 2022

Error : Data path "" must NOT have additional properties(styleext).   Solution: In the angular.json file change from "styleext": "scss" to "style": "scss" Error: More than one module matches. Use the skip-import option to skip importing the component into the closest module or use the module option to specify a module. Solution: ng generate component componentname--module app or ng g c componentname --module app   Error: Could not find module "@angular-devkit/build-angular" when issuing the command ng serve Solution 1 : ng update Solution 2 : First delete the node_modules and issue these commands npm install  & npm update Solution 3 : npm install --save-dev @angular-devkit/build-angular@latest

What will happen if we apply the enableProdMode() in Angular?

Applying enableProdMode() in the Angular project will do the following things  * The Change Detection will check only once contrast to development mode is doing for 2 times * The configuration file will change to 'environment.prod.ts' (Not necessarily the same name, we can set different name in the angular.json file) * Turns off the assertions  * Turns off the regular checks in framework which is happening in development mode  * The performance will be relatively high compared to development mode 

Common issues with Angular Programming Development and Fixes

         Angular programmers may face these types of common errors all the way in their programming path, here are the few issues and fixes to them.          1) Can't bind to 'formGroup' since it isn't a known property of 'form'   The ReactiveFormsModule might be in missing in the app.module.ts imports section   Import the ReactiveFormsModule   imports:  [ ReactiveFormsModule ]   And don’t forgot to specify the imports import  {  ReactiveFormsModule  }  from   '@angular/forms' ;     2)          Can't bind to 'ngModel' since it isn't a known property of 'input'.   Cause: The FormsModule might be in missing in the app.module.ts imports section   Import the FormsModule        imports:  [      BrowserModule ,      AppRoutingModule ,      FormsModule   ],   And don’t forgot to specify the imports import  {  FormsModule  }  from   '@angular/forms' ;   3)          Nu