Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228554 articles
Browse latest View live

Property 'alert' does not exist on type 'LoginPage'

$
0
0

Hi, I,m using ionic 4 to build a mobile apps. I got an error when I try to connect login and signup with firebase. But I got error Property ‘alert’ does not exist on type ‘LoginPage’ at line const alert = await this.alert.create. Can anyone help me with this?

import { Component, ViewEncapsulation } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';
import { AngularFireAuth } from '@angular/fire/auth'
import { auth } from 'firebase/app'
import{ AlertController } from '@ionic/angular'
import { UserData } from '../../providers/user-data';

import { UserOptions } from '../../interfaces/user-options';



@Component({
  selector: 'page-login',
  templateUrl: 'login.html',
  styleUrls: ['./login.scss'],
})
export class LoginPage {
  login: UserOptions = { username: '', password: '', copassword:'' };
  submitted = false;

  constructor(
    public afAuth: AngularFireAuth,
    public userData: UserData,
    public router: Router,
    
  ) { }

  async onlogin (username: string, password: string) {
    this.submitted = true;
    
    try{

      const res = await this.afAuth.auth.signInWithEmailAndPassword(username +'@codedamn.com',password)
      console.log(res)
      this.router.navigate(['/tabs'])
    } catch(error){
      console.dir(error)
      this.showAlert("Error", "User not found")

      if (error.code =="auth/user-not-found"){
        console.log("User not found")
      }
    }
  }
  async showAlert(header: string, message: string) {
    const alert = await this.alert.create ({ // error is here
      header,
      message,
      buttons: ["Ok"]
    })

    await alert.present()
  }
}

Using ionic 4 and ng2-pdf-viewer getting “ERROR Error: Uncaught (in promise): Error: Template parse errors”

$
0
0

You were correct, I actually had to add the import into the home.module.ts and it worked.

Thank you!

Property 'alert' does not exist on type 'LoginPage'

$
0
0

solved by adding public alert: AlertController

Loading Google Calendar with Google Login

$
0
0

Is there any solution with google calendar?

I wanna load google calendar event on my calendar and add events.

I try with this

It’s not OK on me. You guy have any solution. It’s better without firebase.

Please, help me.

Ionic 4 ion-select is not opening select options

$
0
0

Im using ion-select in my page but when i click on select it will not showing option and then i cant click on input field also of other items . Also not opening the ion-select box to select the values.

<ion-content>

    <ion-item>
      <ion-label  position="floating" color="primary">Name</ion-label>
      <ion-input type="text"></ion-input>
    </ion-item>

    <ion-item>
      <ion-label  position="floating" color="primary">Phone Number</ion-label>
      <ion-input type="number"></ion-input>
    </ion-item>

    <ion-item>
      <ion-label  position="floating" color="primary">CNIC</ion-label>
      <ion-input type="number"></ion-input>
    </ion-item>

  <ion-item>
    <ion-label>Gender</ion-label>
    <ion-select placeholder="Select One">
    <ion-select-option value="f">Female</ion-select-option>
    <ion-select-option value="m">Male</ion-select-option>
   </ion-select>
   </ion-item>

</ion-content>

Is this is bug or any solution to fix it ?

Ionic 4 Input with icon

Ionic Scroll Bottom ?*

$
0
0

wow…thanks alot…i tried the above methods using content.scrollbottem .but they condradict with virtual scrolling feature in ionic.anyway thanks to you now everythings fine.

Convert image into multipart and send to post server with key in ionic3

$
0
0

convert image into multipart and send to post server with key value pair ionic3

// Destination URL
let url = AuthServiceProvider.URLBase+‘json_register.php’;

// File for Upload
var targetPath = this.pathForImage(this.lastImage);;

// File name only
var filename = this.lastImage;

var options = {
latitude: this.lat,
longitude: this.lng,
“securitycodenew”:AuthServiceProvider.SecurityCode,
photo : this.myphoto,
refer_from_email:’’,
fileKey: “file”,
fileName: filename,
chunkedMode: false,
mimeType: “multipart/form-data”,
params : {‘fileName’: filename},
headers: {
‘Content-Type’: undefined,
‘Authorization’: 'Bearer ’ + localStorage.getItem(‘access_token’)
}
};

const fileTransfer: FileTransferObject = this.transfer.create();

// Use the FileTransfer to upload the image
return fileTransfer.upload(targetPath, url, options).then(data => {
return data;
}, (err) => {
return err;
// alert(“Errrr”+ JSON.stringify(err));
});

in this i can’t understand that how to send values in key value pair like securitycode and how to send image in key pair.


Ionic 4 Input with icon

$
0
0

Just add input and after it add your icon with slot=“end”

    <ion-item>
      <ion-label position="floating">Floating Label</ion-label>
      <ion-input></ion-input>
      <ion-icon name="eye" slot="end"></ion-icon>
    </ion-item>

hope it helps you :slight_smile:

Ionic 4 devapp debugging

$
0
0

Add platform and run the command again.

Ionic 4 Input with icon

$
0
0

Thanks @gokujy :v:, it works,
I did that, but i added icon above ion-input

Ionic 4 Input with icon

InfiniteScroll bug or problem

$
0
0

i had this issue when i used a manual scrolling in my .ts page.that is “content.scrolltop”…something like that. my best guess is that that too condradicts and cause the same issue.finally i used css for the same scrolling effecttry this link…it helps.

Ionic3 w/ New Stripe v3

$
0
0

Anyone else successful with Ionic3 and the new Stripe payment gateway integration?
I’m only using script src=“https://js.stripe.com/v3/
calling stripe checkout sessions to get sessionId then passing it to stripe redirectToCheckout.
everything goes smoothly and payment is successful, apparently i get stuck on the successURL redirect. problem is… it is a required parameter. I can’t close this redirect page(because its technically a webpage) to go back to my app.

Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin'] in ionic 4

$
0
0

After installing these phone gap plugins:

ionic cordova plugin add phonegap-plugin-push
npm install @ionic-native/push

I am getting this error:

Below is my ./platforms/android/project.properties file

target=android-28

android.library.reference.1=CordovaLib

android.library.reference.2=app

cordova.gradle.include.1=cordova-plugin-firebase/starter-build.gradle

cordova.system.library.1=com.google.android.gms:play-services-tagmanager:+

cordova.system.library.2=com.google.firebase:firebase-core:+

cordova.system.library.3=com.google.firebase:firebase-messaging:+

cordova.system.library.4=com.google.firebase:firebase-config:+

cordova.system.library.5=com.google.firebase:firebase-perf:+

cordova.system.library.6=com.android.support:support-annotations:27.+

cordova.gradle.include.2=cordova-support-google-services/starter-build.gradle

cordova.system.library.7=com.android.support:support-v13:27.+

cordova.gradle.include.3=phonegap-plugin-multidex/starter-multidex.gradle

cordova.system.library.8=me.leolin:ShortcutBadger:1.1.17@aar

cordova.system.library.9=com.google.firebase:firebase-messaging:11.6.2

I know this is already asked question I tried all these solutions ,nothing worked for me.


Ionic 4 Cordova - Run Android Firebase error all of a sudden

$
0
0

Thank you so much took me two days to figure it out.

Ionic 4 devapp debugging

$
0
0

What do you mean?
I have iOS and Android added already.

Ionic 4 devapp debugging

Barcode reader crashes the app after permission request

$
0
0

I am having the same issue. Any suggestions?

Dynamic modul loading

$
0
0

@bakondis were u able to get this done? i am trying to implement the same too. host modules in server and download in app in runtime.

Viewing all 228554 articles
Browse latest View live


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