Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 71531 articles
Browse latest View live

Ion-segment like Andriod Tab


Ionic 4 for eCommerce

$
0
0

@sourabhchopade03 wrote:

I want to create a new eCommerce application for my organization. So is it good to use Ionic 4(New released) or should i stick to Ionic 3. Please suggest me the version. I am so confused. Thanks

Posts: 2

Participants: 2

Read full topic

How does saving history and restore works in changing tabs?

$
0
0

@jaygauten wrote:

Hi,

we’d would like to understand how parallel history works on tabs - how it was stored and rewind when revisiting the tab

TIA

Posts: 1

Participants: 1

Read full topic

Ionic Google analytics

$
0
0

@Harikag wrote:

Error: undefined is not an object (evaluating ‘window.FirebasePlugin.grantPermission’)

So please help me. Thanks in advance

Posts: 1

Participants: 1

Read full topic

Creating swipe up modal as in uber

$
0
0

@shubhamvo wrote:

I want to create a modal type of thing where in if I swipe a div up than it swipes up and div comes up as in uber.

Posts: 1

Participants: 1

Read full topic

Ionic cordova run android ERROR - NEWBIE

$
0
0

@PratikVaity wrote:

Hello,
When I run ionic cordova run android I get the following Error…

Even When I set JAVA_HOME environment variable I am still having this error…
Can anyone tell me whats the problem and How can I solve this…
Thank you.

Posts: 1

Participants: 1

Read full topic

Ionic 3 screenOrientation.lock not working

Issue in Native HTTP with POST request in iOS

$
0
0

@OmDIonic wrote:

I am trying POST request using native HTTP in iOS but its not working.
GET with both angular http and native http working perfect but POST with angular and native http not working.

My Ionic Info:
Ionic:

ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.1.1
@angular-devkit/build-angular : 0.13.5
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.5
@ionic/angular-toolkit : 1.4.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 8 other plugins)

System:

ios-deploy : 1.9.4
ios-sim : 8.0.0
NodeJS : v10.15.3 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61


Code for POST request in iOS

import { HTTP } from ‘@ionic-native/http/ngx’;

const httpOptions = {
headers: new HttpHeaders({
‘Authorization’: Authorization,
‘Content-type’ : ‘application/json’,
})
};

const body = new HttpParams()
.set(‘grant_type’, ‘authorization_code’)
.set(‘client_id’ , this.client_id)
.set(‘redirect_uri’, this.redirect_url)
.set(‘code’,code);

this.http.post(this.token_url, body,httpOptions)
.then(data => {
console.log(’–token res–’+JSON.stringify(data));
})
.catch(error => {
console.log(’–token err–’+JSON.stringify(error));
});

can anybody help me out here.

Posts: 1

Participants: 1

Read full topic


HTTP Post in iOS not working

$
0
0

@OmDIonic wrote:

HI I am trying for http post request in iOS but its not working and giving error

both angular http and ionic http not for POST request in iOS.

Error Response is

{“ngTempTokenPath”:null,“ngTokenPath”:[“HomePage”,null],“line”:44815,“column”:28,“sourceURL”:“ionic://localhost/vendor.js”}

My Post Request

const httpOptions = {
headers: new HttpHeaders({
‘Authorization’: Authorization,
‘Content-type’ : ‘application/json’,
})
};

const body = new HttpParams()
.set(‘grant_type’, ‘authorization_code’)
.set(‘client_id’ , this.client_id)
.set(‘redirect_uri’, this.redirect_url)
.set(‘code’,code);

this.http.post(this.token_url,body
,httpOptions).subscribe(
(response) => {
console.log(‘Token recived------------’+response);
},
(error) => {
console.log(‘res-----’+JSON.stringify(error));
if (error.error instanceof ErrorEvent) {
// A client-side or network error occurred. Handle it accordingly.
console.error(‘An error occurred:’, error.error.message);
} else {

    // The backend returned an unsuccessful response code.
    // The response body may contain clues as to what went wrong,
    console.error(
      `Backend returned code ${error.status}, ` +
      `body was: ${error.error}`);
  }
});

Can anybody tell my mistake.

Posts: 1

Participants: 1

Read full topic

Hello Ionic 4 sample app guide

Best practice Ionic component + javascript custom component

$
0
0

@Nephren wrote:

I have a question about best practice about ionic component and custom component.

For example with ION-MODAL:

_the “Usage” section specify that:

<body>
  <ion-modal-controller></ion-modal-controller>
</body>
customElements.define('modal-page', class extends HTMLElement {
  connectedCallback() {
    this.innerHTML = `
<ion-header>
  <ion-toolbar>
    <ion-title>Super Modal</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content>
  Content
</ion-content>`;
  }
});

async function presentModal() {
  // initialize controller
  const modalController = document.querySelector('ion-modal-controller');
  await modalController.componentOnReady();

  // present the modal
  const modalElement = await modalController.create({
    component: 'modal-page'
  });
  await modalElement.present();
}

it’s cool for a modal with few complexity, but in my case I decided to create a separate and custom component with its own tag.
I get it by its ID and affect the “component” attribute in the create function with my custom element.
it look like that:

<body>
  <ion-modal-controller>
    <my-custom-modal id="my-custom-modal"
     :props1="toto"
     @close-modal="closeModal">
    </my-custom-modal>
  </ion-modal-controller>
</body>
 presentModal() {
  const modalController = document.querySelector('ion-modal-controller');
  const myCustomModal= document.getElementById('my-custom-modal');
  modalController.componentOnReady()
  .then(() => {
  modalController.create({
    component: myCustomModal })
    .then((modalElement) => {
      modalElement.present();
    });
  });
}

My question is there.
I don’t know where i must put my custom component tag…
In the ion-modal-controller tag, like that my custom tag can be displayed only when I trigger the ion-modal-controller or outside the ion-modal-controller tag ?

Posts: 1

Participants: 1

Read full topic

When i pass data through navCtrl it show me the data as an object on next page

$
0
0

@FK2193 wrote:

my question is after adding patient data and then passing that data as an object on the next page and then when I save that object in the database it gives me an error like this object(…) is not a function ionic, so how can I resolve that issue?

**Move data from Patient to Medicine Page then Medicine to Schedule **

patient:Patient;
export class AddPatientPage {
  AllPatient:any;
constructor(public navCtrl: NavController,
              private databasedata: DatabasedataProvider,
              public loadincontroller:LoadingController,public navParams: NavParams) {
this.patient=new Patient(this.id,this.name,this.doctor_name,this.hospital_clinic,this.date,'pending');
this.AllPatient=this.patient;
  }
patientadd() {
  
    this.navCtrl.push(MedicinedisplayPage, {patientdata: this.AllPatient});
}

MedicineDisplay.ts page

 patientdata:string;

  constructor(public navCtrl: NavController, public loadingcontroller:LoadingController,
              public medService: MedicineServicerProvider,
              public Alert:AlertController,public navParams: NavParams, public toast:ToastController) {
 
         this.patientdata=this.navParams.get("patientdata");
}

Medicinedisplay.html

 <div>
      <h5>Parameters passed:</h5>

      <pre style="background-color: #f8f8f8">selections: [
        {{patientdata}}
        ]</pre>

    </div>

Captureyyy

Posts: 6

Participants: 2

Read full topic

Unchecking not happen in Ion-checkbox in Ionic4

$
0
0

@venkat-chuchu wrote:

In my scenario having checkbox if all checkbox are checked, then ‘any checkbox’ checked by default, that time all the checkbox are unchecked except ‘any checkbox’ but last checkbox was not unchecked. I used the $event for checking or uncheck.

Posts: 1

Participants: 1

Read full topic

CallNumber is not assignable to type Provider

$
0
0

@pdj wrote:

I imported in app.module.ts

import { CallNumber } from ‘@ionic-native/call-number’;

on node_modules folder, @ionic-native - call-number - index.d.ts is as below

import { IonicNativePlugin } from '@ionic-native/core';
/**
 * @name Call Number
 * @description
 * Call a number directly from your Cordova/Ionic application.
 * **NOTE**: The iOS Simulator (and maybe Android Simulators) do not provide access to the phone subsystem.
 *
 * @usage
 * ```typescript
 * import { CallNumber } from '@ionic-native/call-number';
 *
 * constructor(private callNumber: CallNumber) { }
 *
 * ...
 *
 *
 * this.callNumber.callNumber("18001010101", true)
 *   .then(res => console.log('Launched dialer!', res))
 *   .catch(err => console.log('Error launching dialer', err));
 *
 * ```
 */
export declare class CallNumber extends IonicNativePlugin {
    /**
     * Calls a phone number
     * @param {string} numberToCall The phone number to call as a string
     * @param {boolean} bypassAppChooser Set to true to bypass the app chooser and go directly to dialer
     * @return {Promise<any>}
     */
    callNumber(numberToCall: string, bypassAppChooser: boolean): Promise<any>;
    /**
     * Check if call feature is available
     * @return {Promise<any>}
     */
    isCallSupported(): Promise<any>;
}

Posts: 2

Participants: 2

Read full topic

Last version of @ionic-native compatible with ionic 3?

$
0
0

@Hanzo wrote:

Hi

I have created a v3 project with:

ionic start testV3 sidemenu --type=ionic-angular

The obtained package.json is this:

{
  "name": "testV3",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "~4.18.0",
    "@ionic-native/splash-screen": "~4.18.0",
    "@ionic-native/status-bar": "~4.18.0",
    "@ionic/storage": "2.2.0",
    "ionic-angular": "3.9.3",
    "ionicons": "3.0.0",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.29"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.1",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project"
}

Means this that the latest version of @ionic-native compatible with 3.+ ionic versions is 4.18.0 ?

Thanks

Posts: 1

Participants: 1

Read full topic


Desing problem: Ionic 4 + navbar bootstrap + routing

$
0
0

@NurGuz wrote:

Hi guys,

I have a problem with this code

<ion-app>
    <apaa-menu></apaa-menu>
    <ion-router-outlet main></ion-router-outlet>
</ion-app>

apaa-menu is a component with a , and ion-router-outlet my routing pages.

All pages that I print into ion-router-outlet was superimposed into my navbar.

Any idea¿

Posts: 1

Participants: 1

Read full topic

Disable back button

After storing item in storage it is not removing when pressed delete item button

$
0
0

@aditbharadwaj wrote:

Whenever i add any product in wishlist , i can not remove it from wish list unless i log out or clean storage.
the same code i use in for CheckoutCart in that i can add as well as remove products from Checkoutcart array storage.
wish.html


<div class="heading uppercase">
      Products in Your Wishlist
</div>


  <div class="width50" *ngFor="let object of wishdata" text-center style="height:250px">
    <ion-icon name="close-circle" class = "topright" (click)= "deleteitem(object)"></ion-icon>
    <img src="{{object.images[0].src}}" style="height: 70%" (click)="navigateToPage(object.id, object)" />
    <div class="product-name uppercase" padding-top padding-horizontal text-nowrap style="min-width: 0; overflow: hidden; text-overflow: ellipsis;">{{object?.name}}</div>
    <span class="price" *ngIf="object?.meta_data[14]?.key == 'inApp'">&#8377; {{object?.meta_data[14]?.value}}</span>
    <span class="price" *ngIf="!object?.meta_data[14]?.key != 'inApp'">&#8377; {{object?.price}}</span>
  </div>

</ion-content>

Wish.ts code for deleteitem()

async deleteitem(object){
    var index = this.wishdata.indexOf(object);
    if (index > -1) {
      this.wishdata.splice(index, 1);
      await this.storage.set('products', this.wishdata);
    }
    this.navCtrl.setRoot(this.navCtrl.getActive().component);
  }

Cart.html

<div class="width50" *ngFor="let object of cartdata" text-center style="height:250px">
    <ion-icon name="close-circle" class = "topright" (click)= "deleteitem(object)"></ion-icon>
    <img src="{{object.images[0].src}}" style="height: 70%" />
    <div class="product-name uppercase" padding-top padding-horizontal text-nowrap style="min-width: 0; overflow: hidden; text-overflow: ellipsis;">{{object?.name}}</div>
      <span class="price" *ngIf="object?.meta_data[14]?.key == 'inApp'">&#8377; {{object?.meta_data[14]?.value}}</span>
      <span class="price" *ngIf="!object?.meta_data[14]?.key != 'inApp'">&#8377; {{object?.price}}</span><br/>
</div>

cart.ts delete item function

async deleteitem(object){
    var index = this.cartdata.indexOf(object);
    if (index > -1) {
      this.cartdata.splice(index, 1);
      await this.storage.set('products', this.cartdata);
    }
    this.navCtrl.setRoot(this.navCtrl.getActive().component);
  }

Can any1 help what am i doing wrong as the code is similar for both the carts but one works and one does not ?

Posts: 4

Participants: 2

Read full topic

Pass parameters, obtaining a specific value of the parameters

$
0
0

@dbarett wrote:

I am passing parameters between views, but I need from the view certificates to read a specific value that is inside the navparams, for this value send it to the provider to load_detail certificate that expects as parameters the certificate number, but I do not know how to pass the value of the number of certificate of the parameters that I am sending from the previous view

Posts: 1

Participants: 1

Read full topic

Help rest api

$
0
0

@hgaleano wrote:

My web service method is executed after I finish executing other methods

Example

service.GetUsers ()
TotalUser ()

The TotalUser () method is executed first

Posts: 1

Participants: 1

Read full topic

Viewing all 71531 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>