Skip to main content

Posts

Showing posts from August 7, 2021

IONIC – Add and play audio files in the Angular based Ionic project

To add and play the audio files in the IONIC Angular project, the following steps are needed. Many Thanks to Matthew Hoelter for the simplified example! 1)         Install the NativeAudio ionic cordova plugin add cordova-plugin-nativeaudio   npm install @ionic-native/native-audio 2)         Import the NativeAudio import  {  NativeAudio  }  from   '@ionic-native/native-audio' ; 3)         Create a service of your desired name here I am providing ‘AudioServiceProvider’ ionic g s AudioServiceProvider 4)         In the constructor inject the NativeAudio constructor ( public   platform :  Platform , private   nativeAudio :  NativeAudio ) { console . log ( 'Hello AudioServiceProvider Provider' ); } 5)         In the platform loaded function unload any existing audio, you can do this dynamically for the existing audio files this . platform . ready (). then (()  =>  {  console . log ( "platform is ready!" );   this . nat

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