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

Nav controller was destroyed with ionic 3 lazy loading

$
0
0

I have problem with lazy loading and using split-pane's menu.

My app has root page in app.component.ts (code below) where rootPage set to LoginPage by default and after login's check it change to MenuPage. Menu Page has <ion-split-pane> with own <ion-nav> directive (code below). At this point I get error:

ERROR Error: Uncaught (in promise): nav controller was destroyed
at c (polyfills.js:3)
at Object.reject (polyfills.js:3)
at NavControllerBase._fireError (nav-controller-base.js:318)
at NavControllerBase._failed (nav-controller-base.js:297)
at nav-controller-base.js:361
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.es5.js:4149)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3

If I change default page to MenuPage all works greats and other pages open without errors! If I change rootPage after login's check to page without ion-nav or split-pane also all works great! How can I fix this?

app.component.ts:

@Component({
  template: `<ion-nav #root [root]="rootPage"></ion-nav>`
})

export class IonicApp {

  @ViewChild(Nav) nav: Nav;
  rootPage: any = 'LoginPage'; // rootPage: any = MenuPage' works great

  constructor(public user: User) {
    this.checkLogin();
  }

  checkLogin() {
    this.user.checkLogin()
      .map(res => res.json())
      .subscribe(res => {
        if (res.success)
          this.rootPage = 'MenuPage'; // this.nav.setRoot('MenuPage') also not work but this.rootPage = 'BuyPage' works!
      }, err => {
        //console.error('ERROR', err);
      });
  }
}

menu.html:

<ion-split-pane>
  <ion-menu [content]="content">
    <ion-list>
    	<ion-item *ngFor="let p of pages" menuClose detail-none (click)="openPage(p)">
	    	<ion-icon name="{{p.icon}}" item-start></ion-icon>
        {{p.title}}
      </ion-item>
    </ion-list>
  </ion-menu>

  <ion-nav #content main [root]="rootPage"></ion-nav>
</ion-split-pane>

menu.ts:

export class MenuPage {

  @ViewChild('content') nav: Nav;
  rootPage: any = 'AdvertsPage';

...
}

Set mode of alert and toast

$
0
0

Hello,

Quick question. With html element it is easy to set the mode of the component with mode=md or mode=ios

However is there a way to do the same on alert (I would like to set it to md) and toast (I would like to set it to ios :slight_smile:)

Do you maybe know how to do it?

When I click on the swipe button it also clicks on the parent item

$
0
0

SOLVED!

<ion-content>
    <ion-list>
        <ion-item-sliding *ngFor="let chat of chats | async" >
            <ion-item (click)="openChat(chat.$key)">
                <ion-avatar item-left>
                        <img *ngIf="!(chat.info | async).sPicture" src="assets/images/default.jpg">
                        <img *ngIf="(chat.info | async).sPicture" src="{{(chat.info | async).sPicture}}">
                </ion-avatar>
                <span>{{(chat.info | async).sDisplayName}}</span>
            </ion-item>

            <ion-item-options side="right">
                <button ion-button color="danger" (click)="deleteChat(chat.$key)">Delete</button>
            </ion-item-options>

        </ion-item-sliding>
    </ion-list>
</ion-content>

Error: Could not find gradle wrapper within android sdk. Might need to update yo ur Android SDK

$
0
0

ok, I realized that I was always looking into ionic service documentation. Thanks for reminding. I found now ionic main tutorial.

Extend Ionic 2 component

$
0
0

Hey! Did you find a way to fix this? Thanks!

Error: exporting my App from Creator

$
0
0

I already had the cordova added, and when i run ionic cordova run android it appears

BUILD SUCCESSFUL

Total time: 2 mins 2.535 secs

Built the following apk(s):
** C:/Users/Administrador/FMCanovelles2017/platforms/android/build/outputs/**
apk/android-debug.apk

ANDROID_HOME=C:\Users\Administrador\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
No target specified and no devices found, deploying to emulator

Error: No emulator images (avds) found.
1. Download desired System Image by running: "C:\Users\Administrador\AppData\Loc
al\Android\sdk\tools\android.bat" sdk
2. Create an AVD by running: "C:\Users\Administrador\AppData\Local\Android\sdk\t
ools\android.bat" avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM devi
ce driver

[ERROR] Cordova encountered an error.
** You may get more insight by running the Cordova command above directly.**

[ERROR] An error occurred while running cordova run android (exit code 1).

Up to date I've been able to create an android-release-unsigned.apk file following the steps on generate apk but when I install it on my device it says "App not instaled"

I may done something wrong?

How to write data to a csv file in ionic 3

$
0
0

I want to get all the call logs written in a file and want to export this as a csv file..

We are looking for a partner, Fitness Start Up

$
0
0

Hello,

My name is Miguel Ángel, along with other partners I am working on a very ambitious project (b2b & b2c) with a very interesting push & pull business model.

You can visit us at app.TheRock5.com and youtube and instagram (therock5official). We have already launched the first version of the MVP and we are working with sports centers.

Currently we are organizing a seed round, we already have 4 investors who have expressed their desire to participate and we have been selected for an investment fair in July (Alhambra Venture, Granada, Spain).

We are looking for an IT partner with expertise in hybrid apps and front-end. We offer an equity/ percentage of our company. We are looking for a partner, not an employee.

The other IT partner in the project also has great skills and experience.

If you have strong entrepeneurial spirit, willing to work really hard and outstanding skills do not hesitate to send me your CV to miguel@therock5.com.

Thank you for reading this far!
Regards,
Miguel


Square button

$
0
0

how can i center any text vertically? :slight_smile:

How to hide some texts from slide menu ionic 2

$
0
0

Hi @_Ali94

When you register the user detail store in Localstore using ngIf="" you can hide the button of ragister and Log-in and also you can display Log-out button

Thanks

Extending ion-button

$
0
0

Hi, @HugoHeneault

Can you try this..!

import {Component, ElementRef, Renderer} from '@angular/core';
import {Button, Config} from "ionic-angular";
@Component({
  selector: '[search-button]',
  templateUrl: 'search-button.component.html',
  providers:[Button,Config]
})
export class SearchButtonComponent extends Button {
  constructor(ionButton: string, config: Config, elementRef: ElementRef, renderer: Renderer) {
    super(ionButton, config, elementRef, renderer);
  }

Thanks

Getting JSON data based on the item clicked

$
0
0

Hello sir, i just did what you said but i cannot get any data from JSON, it is always 'undefined'.

Show a confirmation alert before app close ionic 2

$
0
0

@rpayanm answer works well.
BUT breaks navigation in modals.
this.nav.pop(); will pop the view but not close the modal before it.

How to hide some texts from slide menu ionic 2

$
0
0

Thank u so much @addwebsolution , But are "root" and "rootscope" supported in ionic 2 ? Because I tried to did some functions with them but there is some thing wrong

Modal controller return object data and object data show in html

$
0
0

I want to show object data as feedback like below screen shot. New feedback will be first here.

i am using below typescript code where data is coming from modal controller.

modal.onDidDismiss(data => {
		for (let products of data) {
			this.feedback_list.push(data);
		}
	});

html code below:

<ion-list *ngFor="let feedback_list of product.user_feedback">
	<ion-item *ngIf="feedback_list.full_name">
		<ion-avatar item-start>
			<img src="assets/img/person.png">
		</ion-avatar>
		<h2>{{feedback_list.full_name}}</h2>
		<p>{{feedback_list.created_date}}</p>
		<ion-note item-end>
			<ion-icon *ngIf="feedback_list.rating<=4" name="star-outline"></ion-icon>
		</ion-note>
	</ion-item>
	<ion-card-content *ngIf="feedback_list.full_name">
		<p>{{feedback_list.feedback}}</p>
	</ion-card-content>
</ion-list>

There is no error but feedback is not showing like image.


Tabs persist after logging out of app, start stacking on log in

We are looking for a partner, Fitness Start Up

$
0
0

Hi, Miguel.
I look forward to a chance to work with you.
My Skype ID is zhao0423.
Thanks.
Regards.

Larger FAB size

$
0
0

why I cant use fab-size:%50 ?
this screen size change depends

Can't display a base64 image like a thumbnail

$
0
0

I tried JPEG and PNG before posting my problem, but no change.
I could display the picture in my PhotoPage without any problems, but no way to display it in my HomePage...

Using Firebase and AngularFire2 Basic Authentication in an Ionic application

Viewing all 228535 articles
Browse latest View live


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