Posts

Showing posts from 2022

excel download in angular

  download (){     if ( this . fromdate2 == undefined ){       this . filename = "AllIssues" ;     } else {       this . filename = this . fromdate2 ;     }             this . downloadFile ( this . jsonData , this . filename );   }     downloadFile ( data , filename = 'data' ) {     let date ;     if ( this . fromdate2 == undefined ){     date = '' ;     } else {       date = 'Month: ' + this . fromdate2 ;     }     let csvData = this . ConvertToCSV ( data , [ 'ArmyNo' , 'Name' , 'Rank' , 'Unit' , 'Issue' , 'ReportedOn' , 'ResolvedOn' ]);     console . log ( csvData );       let blob ;     if ( date == '' ){         blob = new Blob ([ ' \ufeff ' + csvData ], { type : 'text/csv;charset=utf-8;' });         } else {   ...

sorting array

  //   const ascendingComparator = (a:any, b:any) => (a.activitydate > b.activitydate) ? 1 : -1; //   //   const descendingComparator = (a:any, b:any) => (a.activitydate > b.activitydate) ? -1 : 1; //   //   debugger; //   //   console.log(order[0][1]); //   //   if(order[0][1]=="desc"){ //   //   ai.rowsdata = ai.rowsdata.sort(descendingComparator); //   //   console.log(ai.rowsdata); //   // } // sortFunction1(a:any, b:any){     //   var dateA = new Date(a.activitydate);     //   var dateB = new Date(b.activitydate);     //   console.log(dateA > dateB,dateA < dateB );     //   if(dateA > dateB){     //     return dateA > dateB ? -1 : 1;     //   }else if(dateA < dateB){     //     return dateA > dateB ? 1 : -1;     //   }else{     //   ...

imp links

 https://www.npmjs.com/package/ionic-long-press long press example https://devdactic.com/custom-ionic-animations/ small animations

pdf upload in angular

  pdfOnload(event) {      const file = event.target.files[0];     const reader = new FileReader();     reader.readAsDataURL(file);     reader.onload = () => {         console.log(reader.result);          this.base64=reader.result;     };   }  <div class="form-group">                         <label for="file">Attach1</label>                         <input type="file"                                id="file" accept="pdf/*"                                  (change)="pdfOnload($event)">                     </div...

image upload in angular

   <input class="display1"                         type="file"                         id="fileInput"                         name="fileInput"                         accept="image/*"                          (change)="selectFiles($event)"                       /> selectFiles(event: any): void {          this.selectedFileNames = [];     this.selectedFiles = event.target.files;     this.previews = [];     if (this.selectedFiles && this.selectedFiles[0]) {       const numberOfFiles = this.selectedFiles.length;       for (let i =...

angular app

import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, throwError } from 'rxjs'; import { catchError, retry } from 'rxjs/operators'; import {Location, LocationStrategy, PathLocationStrategy} from '@angular/common'; @Injectable({ providedIn: 'root' }) export class ApiService { location: Location; apiURL='http://207.38.84.105/CT/api'; constructor(private http: HttpClient,location: Location){ this.location = location; } Login(data){ return this.http.post(this.apiURL + '/loginCT.php',data) .pipe( retry(1), catchError(this.handleError) ) } queryCandidateget(data){ return this.http.post(this.apiURL + '/queryCandidateget.php',data) .pipe( retry(1), catchError(this.handleError) ) } searchInsert(data){ return this.http.post(this.apiURL + '/insertCandidateSearches.php...

npm

 sudo apt-get remove nodejs sudo apt-get remove npm Then go to /etc/apt/sources.list.d and remove any node list if you have. Then do a sudo apt-get update Check for any .npm or .node folder in your home folder and delete those. If you type install node nvm install 12.14.0 error ionic npm i paulstelzer-ionic-angular-toolkit

git

 echo "# test" >> README.md git init git add README.md git commit -m "first commit" git branch -M main git remote add origin https://github.com/bhavanigattikoppula/test.git git push -u origin main

Android path

  #JAVA HOME directory setup export JAVA_HOME=/usr/lib/java/jdk1.8.0_221 export PATH="$PATH:$JAVA_HOME/bin" export ANDROID_HOME="/home/nssdt022/Android/Sdk/" export PATH="${PATH}:${ANDROID_HOME}build-tools/:${ANDROID_HOME}platform-tools/" export CAPACITOR_ANDROID_STUDIO_PATH="/usr/local/android-studio/android-studio/bin/studio.sh"