Posts

Showing posts from April, 2021

Example Filter,sort,map Observable stream

Example 1 sort array of object alphapitaclly . Array of countries     findAllCountry ( token :  string ):  Observable < ICountry []> {      const   headerInfo  =  new   HttpHeaders ({        Authorization :   token ,     });      return   this . http       . get < ICountry []>(          ` ${ environment . backendUrl } /crm-operations/lookup/country` ,         {  headers :   headerInfo  }       )       . pipe (          tap (( data )  =>            data . sort (( a ,  b )  =>  {              if  ( a . couShortNameE  <  b . couShortNameE ) {                return  - 1 ;             }              if  ( a . couShortNameE  >  b . couShortNameE ) {                return   1 ;             }           })         )       );   }     Example 2 async   findAll ( token :  string ):  Promise < Observable < ComprehensiveLimit []>> {      let   customer  =  await   getSessionInfo ( "customer" );      const   headerInfo  =  new   HttpHeaders ({        Auth

Upgrade From Capacitor V2 to V3

-- First Check the current version npx cap doctor -- Then install the new version of capacitor npm install @capacitor/cli@next @capacitor/core@next     -- and install the new version of capacitor/android npm install @capacitor/android@next -- check again npx cap doctor   --every this is ok? Then install pluggins you want  npm install @capacitor/keyboard npm install @capacitor/haptics  npm install @capacitor/app npm install @capacitor/storage   -- after all updates done , Sync the project npx cap sync -- if you want to check for the latest updates,run  npx npm-check-updates -u  -- then  npm install npm install -- of any problems occure due to update  of typescript , youcan downgrade type script like this //downgrade typescript version npm install typescript@">=4.0.0 <4.2.0" -- replace " with ' in linux   // removing plugin 1- remove it from package.json 2- npm uninstall <<plugin name ecample action-sheet>> 3- npx cap sync