Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 48980 articles
Browse latest View live

Ionic v4 form ngSubmit not triggering

$
0
0

@dev-gilbert wrote:

Hello guys, I am having difficulties trying to implement a simple login form.

@Component({
  selector: "app-login",
  templateUrl: "./login.page.html",
  styleUrls: ["./login.page.scss"]
})
export class LoginPage implements OnInit {
  constructor(private service: AuthenticationService) {}
  user = {};

  login() {
    this.service.login();
  }

  onSubmit() {
    console.log(this.user);
  }
}
<form (ngSubmit)="onSubmit()">
    <ion-item>
      <ion-label position="floating">Username</ion-label>
      <ion-input
        type="text"
        [(ngModel)]="user.username"
        name="username"
      ></ion-input>
    </ion-item>
    <ion-item>
      <ion-label position="floating">Password</ion-label>
      <ion-input
        type="text"
        [(ngModel)]="user.password"
        name="password"
      ></ion-input>
    </ion-item>
    <ion-button type="submit" expand="block">Sign up</ion-button>
  </form>

When I click the sign up button I don’t see anything in the console. What am I missing here?

Posts: 1

Participants: 1

Read full topic


Ionic buttons do not work properly

$
0
0

@thomashuettmaier wrote:

I am new to Ionic and have the problem that in the whole project my buttons are not displayed correctly. They are always displayed white with shadows. If you click on them or move the cursor over them on your PC, they will be displayed normally.
Block buttons, outlined buttons don’t work either.

<ion-content>
      <button ion-item>Save</button>
      <button ion-button>Save</button>
</ion-content>

Posts: 1

Participants: 1

Read full topic

ngFor="let user of users" question

$
0
0

@RenzoM78 wrote:

Hi all,

When I use in the .html:

<ion-card *ngFor="let user of users">
  <img src="{{ user.field_image }}">

Then the image is on the html page.

There is also a {{ user.link }} but I have to put that in an In-app-browser within a ngoninit in the .ts file, what do I have to do to do that in the right way?:

ngOnInit(){

        const browser = this.iab.create('user.link',{location:'no'});

    }

I have to do more than this in the .ts file?

Posts: 1

Participants: 1

Read full topic

Ion-content adjust the screen resolution Ionic 4

$
0
0

@dedemiza wrote:

I would like my ion-content adjusted to the size of the screen. In this case, fill in and do not leave that void at the bottom.

Example with a large resolution:

u73u0

Hence if the height of the screen is smaller, it causes to do scroll, getting that part white, because the bottom does not fill when it does screen scroll

<ion-content >
<ion-grid class="teste">

<ion-item class="a">  
  <ion-label class="flNome" position="floating">NOME</ion-label>
  <ion-input name="title" [(ngModel)]="title" class="nome" type="text" ></ion-input>
</ion-item>



<ion-item class="c">
    <ion-label class="flNome" position="floating">LOCAL DO EVENTO</ion-label>
    <ion-input size="30px" name="evento" [(ngModel)]="evento" class="evento" type="text" ></ion-input>
  </ion-item>


   <ion-item class="d"> 
      <ion-label class="flNome" position="floating">QUAL A SUA FESTA?</ion-label>
    <ion-select name="select" [(ngModel)]="select" okText="Okay" cancelText="Dismiss">
      <ion-select-option value="casamento">CASAMENTO</ion-select-option>
      <ion-select-option value="fifiteenAnos">15 ANOS</ion-select-option>
      <ion-select-option value="formatura">FORMATURA</ion-select-option>
      <ion-select-option value="empresarial">EMPRESARIAL</ion-select-option>
    </ion-select>
  </ion-item>
  <ion-item class="e">
      <ion-label class="flNome" position="floating">CONVIDADOS</ion-label>
      <ion-input  name="conv" [(ngModel)]="conv" class="convidados" type="text" ></ion-input>
    </ion-item>

    <ion-item class="f">
        <ion-label class="flNome" >DATA</ion-label>
        <ion-input  name="date" [(ngModel)]="date" class="data" type="date" ></ion-input>
      </ion-item>

      <ion-item class="g">
          <ion-label class="flNome" position="floating">TELEFONE</ion-label>
          <ion-input  name="tel" [(ngModel)]="tel" class="telefone" type="tel" ></ion-input>
        </ion-item>

        <ion-item class="h">
            <ion-label class="flNome" position="floating">CELULAR</ion-label>
            <ion-input  name="cel" [(ngModel)]="cel" class="celular" type="cel" ></ion-input>
          </ion-item>

          <ion-item class="i"> 
            <ion-textarea  name="desc" [(ngModel)]="desc" class="desc" maxLength="500" placeholder="ESCREVA MAIS DETALHES (TEMA DA FESTA, CORES)"></ion-textarea>
         </ion-item>

         <ion-button fill="solid" expand="block" class="btn"  (click)="sendEmail()">ENVIAR</ion-button>

    </ion-grid>
</ion-content>
.title{ 

  margin-right:10%; 
  }

 .header {
    --background : rgba(248, 248, 248, 0.5);
}

.teste{
  // --background: url('/assets/images/fundo.png') no-repeat center ;
position:absolute;
    top:0;
    left:0;
    z-index:11;
    background-color: goldenrod;
    width:100%;
    height:100%;
}
   .nome,.evento,.select,.convidados,.data,.telefone,.celular
,.desc{
    font-size: 20px;
    color: rgb(32, 79, 207);
    font-weight: bold;
}   
.a,.b,.c,.d,.e,.f,.g,.h,.i{
    opacity: 0.5;
    border: 2px solid #ffffff;

}

Posts: 1

Participants: 1

Read full topic

Ionic v4 ion-textarea whithin for loop

$
0
0

@sisdev wrote:

Hey guys,

I have an app for taking pictures either from camera or from the gallery and to save them as base64. Obviously it saves the pictures after the save button was clickt.
This bit works fine.

Now I wanted to add an ion-textarea under each picture to let the user put different comments for each picture and after clicking on the save button, all data would be transferred “somewhere”…
This bit doesn’t work because I don’t know how to get the value of ion-textarea

What I’ve done so far is:
.TS file:

public photos;
ngOnInit() {
      ....
      this.photos = [];
      ....
}

takePhoto() {
      ....           
      this.camera.getPicture(options).then(
            imageData => {
                this.base64Image = "data:image/jpeg;base64," + imageData;
                this.photos.push(this.base64Image);                
            }
      ....
}

.html file:

<form #collectForm="ngForm" (ngSubmit)="saveCollectedData(collectForm)">
        <ion-grid *ngIf="photos">
            <ion-row responsive-sm wrap>
                    <ion-col size="6" *ngFor="let photo of photos; let id = index">
                        <ion-card>                            
                            <img [src]="photo" />
                            <ion-textarea rows="4" cols="5"></ion-textarea>
                        </ion-card>
                    </ion-col>
            </ion-row>
        </ion-grid>

        <ion-button class="submit-btn" expand="block" type="submit">Save</ion-button>
    </form>

Now my ion-textarea has to have a dynamic name (I think) but somehow I can’t figure that out.
If I write the ion-textarea like that:

<ion-textarea rows="4" cols="5" [name]="piccomment" [(ngModel)]="collectForm.piccomment"></ion-textarea>

With this I would have the same comment for all pictures which is wrong.

Any ideas how to solve that?

Thanks

Posts: 1

Participants: 1

Read full topic

Query document id from firestore

$
0
0

@NoorAlhuda1990 wrote:

Hi my friends . I have news app in ionic4 and i imported all the news from my database in firestore


the problem that i have that i want when i click on the details button it must show the details of each news in a details page ,
i could that passed the id of every news to deatils page but its just show the id As in the following picture mydata2

my code :
news.page.ts


export class FilmsPage implements OnInit {

  news: Observable<any[]>;
  constructor(public db: AngularFirestore, private router: Router) { }

  ngOnInit() {
      this.news = this.db.collection('123').snapshotChanges().map(actions => {
      return actions.map(a => {
        const data = a.payload.doc.data();
        const id = a.payload.doc.id;
        return { id, ...data };
      });
    });

news.page.html

<ion-content padding>
            <ion-item *ngFor=" let count of news | async">
              <h5>{{count.title}}<ion-button routerLink="/details/{{count.id}}"> details</ion-button>

                <img src="{{count.image}}">
              </h5>

            </ion-item>

    </ion-content>

details.pge.ts

export class DetailsPage implements OnInit {
  id: string;

  constructor(private router: ActivatedRoute, private afs: AngularFirestore) {

   }

  ngOnInit() {
    this.id = this.router.snapshot.paramMap.get('id');
    console.log(this.id);
  }

}

details.page.html

<ion-content padding >
  {{id}}


</ion-content>

Posts: 1

Participants: 1

Read full topic

Issue building an older project with Firebase

$
0
0

@lagoo wrote:

Hey all - trying to rebuild this project but keep hitting a snag. Not sure what it is. I’m not the original developer - when I run “ionic cordova build android” i reach this point (below). I’m not sure what to do to rectify it. I’ve noticed a few posts around the web saying firebase/google services could cause the issue with some suggestions, but I haven’t been able to get it running properly with them. I AM using Firebase in this and hoping to avoid a complete rebuild. Any help would be great, step-by-step would be ideal! My Ionic Info for the project is

Ionic:

   ionic (Ionic CLI)  : 4.10.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.4

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 6.3.0, ios 4.5.4
   Cordova Plugins       : cordova-plugin-ionic-webview 1.1.1, (and 22 other plugins)
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
	at build_cszc8vrrrw5jn35pl9aby66gx.run(/Project/platforms/android/build.gradle:145)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
   > Could not find any version that matches com.google.android.gms:strict-version-matcher-plugin:11.2.+.
     Versions that do not match:
         1.1.0
         1.0.3
         1.0.2
         1.0.1
         1.0.0
     Searched in the following locations:
         .... bunch of files listed ....
     Required by:
         project : > com.google.gms:google-services:4.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.292 secs
Project/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

Posts: 1

Participants: 1

Read full topic

My ionic3 app stopped working now that i started using ionic4

$
0
0

@gigocabrera wrote:

I have been developing a new ionic4 app and all is working fine. I also have an ionic3 app and when I tried to run ionic serve I’m getting an error now:

PS C:\ionic\apps\ionic3\MedicalAnswers-admin> ionic serve
[WARN] Detected locally installed Ionic CLI, but it's too old--using global CLI.
> npm run ionic:serve -- --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[npm] > LiveVault-admin-console@1.0.0 ionic:serve C:\ionic\apps\ionic3\MedicalAnswers-admin
[npm] > npm run serve "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" "--dev-logger-port" "53703" "--nobrowser"
[npm] npm ERR! missing script: serve
[npm] npm ERR! A complete log of this run can be found in:
[npm] npm ERR!     C:\Users\gigoc\AppData\Roaming\npm-cache\_logs\2019-02-19T18_38_19_136Z-debug.log
[npm] npm ERR! code ELIFECYCLE
[npm] npm ERR! errno 1
[npm] npm ERR! LiveVault-admin-console@1.0.0 ionic:serve: `npm run serve "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" "--dev-logger-port" "53703" "--nobrowser"`
[npm] npm ERR! Exit status 1
[npm] npm ERR!
[npm] npm ERR! Failed at the LiveVault-admin-console@1.0.0 ionic:serve script.
[npm] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[npm] npm ERR! A complete log of this run can be found in:
[npm] npm ERR!     C:\Users\gigoc\AppData\Roaming\npm-cache\_logs\2019-02-19T18_38_19_368Z-debug.log

[ERROR] npm has unexpectedly closed (exit code 1).

        The Ionic CLI will exit. Please check any output above for error details.

Posts: 1

Participants: 1

Read full topic


Send files (Docx, pdf and others) from ionic to a server, is it possible?

$
0
0

@diego-guevara wrote:

Good day, I am trying to send files (PDF, Docx and others) to a server but I have not yet been able to, I do not find much information about it, I already managed to do it with images. I would like to know if it is possible to do it with files?

I appreciate any help you can give me

regards

Posts: 1

Participants: 1

Read full topic

NavControl.pop always returns to first tab and not last used tab

$
0
0

@Reesz wrote:

Hello there,

so I’m currently going mad over a problem I’m facing with my Ionic app. Let me explain:
(Disclaimer: I’m new to Ionic/Angular, so it might be some basic understanding of the routing/stack/push concept)
I’ve started with the regular tab-setup. I’ve added two custom (detail) pages with their own routes:

const routes: Routes = [
{...}
  {
    path: 'shoe',
    loadChildren: () => shoeSinglePageModule
  },
  {
    path: 'sale',
    loadChildren: () => saleSinglePageModule
  }
]

These detail pages don’t belong to any tabs, they can be accessed from all of my 4 tabs. Navigation with a forwards animation is no problem. I’ve tried every kind of navigation type: routerLink, navCtrl.navigateForwards etc.

And now comes the problem:
On these detail pages there is a Back-Button that should take you to the tab you’re coming from. But when using navCtrl.pop() to navigate back it always jumps back to the first tab.

I’ve managed to get around this by using navCtrl.back() - this works like I want to. But using the swipe-back method on the pages left edge, seems to use the .pop method under the hood, since the same problem appears - always jumping back to tab 1.

I feel like I’ve read every article on navigation and routing there is - I hope someone can help me out what I’m missing here.

Posts: 1

Participants: 1

Read full topic

Como visualizar documentos en memoria sd

$
0
0

@josele2015 wrote:

Me gustaria saber, si hay una herramienta que permita visualizar documentos que esten dentro un memoria sd, estoy intentando con el plugin file opener pero este plugin tiene el inconveniente que no permite abrir documentos en una sd.

Posts: 1

Participants: 1

Read full topic

Dashcam app

$
0
0

@swagatac wrote:

Is it possible to access a cars dashcam using an ionic app? Can someone suggest any plugin or any other wayto do so?

Posts: 1

Participants: 1

Read full topic

Can't get vuejs ionic project run on Ionic Dev App

$
0
0

@N3X404 wrote:

Hello, i have a ionic project using vuejs, but i cant do " ionic serve -c" when i do it , it trow me an error :

Since you’re using the custom project type, you must provide the ionic:serve **
** npm script so the Ionic CLI can serve your project.

i don’t know what to do, thanks

Posts: 1

Participants: 1

Read full topic

Buggy Documentation

$
0
0

@kolan wrote:

Hello there,
First of all I want to thank you for this good work you are doing. Keep up the good work.

Nevertheless I would like to say please do work on your documentation. They are very very outdated and one faces complicated issues in doing very simple things.

Thank you

Posts: 1

Participants: 1

Read full topic

Ionic 4 and Firestore

$
0
0

@alukkee wrote:

How can I connect and configurate my app with Firestore? I need to do a login an a database in my App.
If someone can help me, do it.

Thankss

Posts: 1

Participants: 1

Read full topic


Does not show location request

Alert handler not executes in ios

$
0
0

@jffs wrote:

I can’t figured out what is going on here. In a view I have a form, then when you submit that form a confirm alert is displayed, if you pick either No or Si option, the alert is dimissed but the handlers never called… The flow to go up to this page is HomePage->OtherPage->THE form Page that display the alert…
Using Android and web browser works as I expected, but not in iOS

I test on an Iphone 7 emulator with iOS 12.
I realise that if the alert was display in the OtherPage works perfect, but in a deeper level not.

Here is my Alert code

 const confirm = this.alertCtrl.create({
        title: 'Guardar teléfono',
        message: '¿Desea agregar el teléfono ' + this.telefono.value + ' a su perfil para futuras reservas?' ,

        buttons: [
          {
            text: 'No',
            handler: () => {
              console.log('Disagree clicked');
            }
          },
          {
            text: 'Si',
            handler: () => {
              console.log('Agree clicked');
            }
          }
        ]
      });
     confirm.present();

Posts: 1

Participants: 1

Read full topic

Ionic 3, 4 & VPN

$
0
0

@HydroCanes wrote:

Hi all,

Has anyone faced this issue? So I am building a mobile app that connects to my work DB using per-app-VPN.

Ionic 4 for iOS only loads/sits at the splash screen and never passes it (I believe its the default error page). Tried using a blank application and had the same result.

I switched back to Ionic 3 using the VPN I was able to pass splash, log in and connect to our database. Would prefer to have both iOS and Android on the same Ionic 4 framework.

Thanks in advance!

Posts: 1

Participants: 1

Read full topic

Ionic UI crash on android device (Ionic 3)

Callback in oauth2 in Ionic v3,v4

$
0
0

@OmDIonic wrote:

Hi All
Can someone help me that
1.How to implement callback in oauth2 in ionic v3,v4

Present Workflow
1.From ionic app I am redirecting to other url for login using Inappbrowser
2.In auth url I added redirect_url as localhost

What is happening
Its not redirecting to ionic app after authorization

What should happen
It should redirect to ionic app and post code so that I can use it for retrieving token.

Note: I also used ssl=true but it not helped bcz portal only accepting https scheme.

Posts: 1

Participants: 1

Read full topic

Viewing all 48980 articles
Browse latest View live


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