Posts

Showing posts from June, 2020

ionic5search

import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; /*   Generated class for the DataProvider provider.   See https://angular.io/guide/dependency-injection for more info on providers   and Angular DI. */ @Injectable({   providedIn: 'root' }) export class DataService{   items:{firstname:any,lastname:any}[]=[];     constructor(public http: HttpClient) {     console.log('Hello DataProvider Provider');   }     getplist(list:any){       list.map(data=>{       this.items.push(data);     });   }   filterItems(searchTerm) {       console.log(searchTerm)     return this.items.filter((item) => {     return item.firstname?item.firstname.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1:'';       });   } }

ionic5 menu submenu functionality

<ion-app>   <ion-split-pane contentId="main-content">     <ion-menu contentId="main-content" type="overlay">       <ion-header>         <ion-toolbar>           <ion-grid style="background-image: linear-gradient(45deg, #165997, #144e8d);           color: #fff;">             <ion-row>               <ion-col size="3">                 <ion-avatar>                     <img src="http://207.38.84.105/Nakhas/public/images/fromserver/sidelogo.png" alt="" class="imagehead" style="width:100%;">                           </ion-avatar>                        ...

ionic3

npm install -g cordova ionic@3.2.0

ionic5 video upload

<ion-item>           <ion-label>Upload Video Resume</ion-label>           <ion-input type="file" (change)="onFileChanged($event)" accept="video/*" formControlName="video"></ion-input>           <video [src]="url" *ngIf="url" height="200" controls></video> <br/>         </ion-item> onFileChanged(event: any) {     if (event.target.files && event.target.files.length > 0) {       const max_size = 20000000;       const allowed_types = ['video/mp4', 'video/avi'];         if (event.target.files[0].size > max_size) {           console.log("entered in loop")           this.imageError = 'Maximum size allowed is ' + max_size / 1000 + 'Mb';           console.log(this.imageError)        ...

ionic multiselect

 <ion-item>       <ion-label>Select class</ion-label>             <ion-select formControlName="class" (ionChange)="selectClass()" multiple="true" [(ngModel)]="classstudy"  cancelText="Nah" okText="Okay!">               <ion-select-option value="{{d.Id}}" *ngFor="let d of class">{{d.class}}</ion-select-option>             </ion-select>           </ion-item>

get data from local JSON file in ionic5

fetch('./assets/data/datajson.json').then(res => res.json())     .then(json => {       this.data = json;     })

menu enable or disable functionality in ionic5

public menu: MenuController,           this.menu.enable(true); this.menu.enable(false);

ionic splash screen icons generation in ionic3 and 4, 5

I use ionic 3 and I think ionic 4 its the same , in your project folder , you have a resources directory, go in. To change the default icon , just change the icon.png by your image, if I remember you need to resize your image (1024*1024). To change the default splashscreen, its the same (2732*2732). Don't forget to rename your image (icon.png and splash.png) And after change, just update your project : ionic cordova resources