Posts

ionic scroll y-axis

 .data{     width: 100%;     height: 100%;      overflow-y: auto;      touch-action: pan-y !important;  }  ion-content{        --overflow:scroll;   }

how to split array as per fixed length, and ionic two dates differences in min,seconds,hours

this . forsasi -->array var perChunk = 5 // items per chunk var inputArray = this . forsasi ; this . result = inputArray . reduce (( resultArray , item , index ) => { const chunkIndex = Math . floor ( index / perChunk ); if (! resultArray [ chunkIndex ]) { resultArray [ chunkIndex ] = [] // start a new chunk } resultArray [ chunkIndex ]. push ( item ); return resultArray }, []) console . log ( this . result ); this . d1 = JSON . parse ( localStorage . getItem ( "starttime" )); var d2 = new Date ( this . d1 ); console . log ( d2 ) var date1 = new Date (); var Str1 = ( "00" + ( date1 . getMonth () + 1 )). slice (- 2 ) + "/" + ( "00" + date1 . getDate ()). slice (- 2 ) + "/" + date1 . getFullYear () + " " + ( "00" + date1 . getHours ()). slice (- 2 ) + ":" + ( "00" + date1 . getMinutes ()). slice (- 2 ) + "...

how to check app running in foreground or background in ionic4

   //Subscribe on pause i.e. background         this.platform.pause.subscribe(() => {           //Hello pause           if(localStorage.getItem("LOG_IN") == "YESORANGE") {                 this.loginprofile=  JSON.parse(localStorage.getItem("Loginprofile"));                 this.api.UserLoginStatus({                   loginUserId: this.loginprofile.Id,                   status:"online"                 }).subscribe((res: any) => {                   console.log(res);                 })               }         });            ...

refresh page when page routing to another page and come back to previous page(like tabs page to another page and other page to came back tabs page that time load the page using below code)

import { NavigationEnd, Router } from '@angular/router'; place the below code in ngOnInt() function inside  this.router.events.subscribe((evt) => {       if (!(evt instanceof NavigationEnd)) {         return;       }       console.log('hai')           });

multiple images url path taking in instagram

 single image taking process Instagram image displaying format 1) instagram user needs login 2) Only public post pictures can copy the link address of the image 3) copy the link address of the image and modify the url  for example: https://www.instagram.com/p/CIDarnTHWHV/?utm_source=ig_web_copy_link modify above link  like this:  use parameter after the url image media/?size=l Thumbnail ?size=t Medium ?size=m Large ?size=l https://www.instagram.com/p/CIDarnTHWHV/media/?size=l;  the above link should work through instagram user login. we can modify the above link , logged in user enter url in browser https://www.instagram.com/p/CIDarnTHWHV/media/?size=l above link change the url format like this : https://instagram.fhyd2-1.fna.fbcdn.net/v/t51.2885-15/e35/128017220_2869929233225574_3640516192658627214_n.jpg?_nc_ht=instagram.fhyd2-1.fna.fbcdn.net&_nc_cat=1&_nc_ohc=vEkiPLbAZq8AX_7P990&tp=1&oh=3e678f161e50badf8d0083983cec8549&oe=5FC9C64C after we ...

social share share multiple urls and base 64 data in ionic4

 share(data) {      console.log(data);     for (var i = 0; i < data.Connected_apps.length; i++) {       console.log(i);       this.urldata.push(data.Connected_apps[i].ExternalLink);          }     console.log(this.urldata.length, data.Connected_apps.length);     if (this.urldata.length == data.Connected_apps.length) {       console.log(this.urldata.length, data.Connected_apps.length);       let arr = this.urldata;     this.newarr = []     for(let i=0;i<arr.length;i++){       if(this.newarr.length>0){           let newarr1 = this.newarr;           this.newarr = [];           this.newarr.push(newarr1[0]+'\n'+'OR'+'\n'+arr[i]);       }else{         this.newarr = []         this.newarr.p...

push multiple data in array(select and disselect items in array)

 <ion-content> <h1 class="h1 margin">Following</h1> <ion-row>   <ion-col size="12" *ngFor="let data of followingdata" (click)="select(data)">     <div  class="newcssbg"  [ngStyle]="{'background-image': 'url(' + data.img +  ')'}">       <div class="overlay">       <p class="innertext">{{data.text}}       <ion-icon *ngIf="data.selected" style="color:#fff;float:right;" name="checkmark-circle-outline"></ion-icon>       </p>    </div>     </div>   </ion-col> </ion-row> </ion-content> <!-- [ngStyle]="data.selected  && {'border': '2px solid green'}" --> ts  select(data) {     // this.followingdataarray.push(data);     this.followingdata.map(e => {               if(e.id==data.id){  ...