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

Object pushed into an array on runtime not displaying correctly

$
0
0

@jusliong wrote:

Hi, I am new to Ionic and Angular (web programming generally) so I may be very poorly informed about some more advanced stuff like JSON, HTTP, etc.

I have a TS file with an object array infoElements, which has property ‘name’, I intend to add more to it, but to keep it simple lets just go with one property in each object. There are two objects in infoElements.

My page TS file:

export class Tab2Page {
  newName = '';
  name = '';
  infoElements = [{name: 'Justin'}, {name:'Alfredo'}]

  updateInfo(value:string){
    this.newName = value;
  }

  onSubmit(){
    this.infoElements.push({name: this.newName});
  }

The updateInfo(string) is for user input, such that the input will be saved to the variable newName
The onSubmit() is bind to a button to push a new object into the array infoElements, and afterwards displayed on the page.

My page HTML file:

<ion-content>
  <div style="max-width: 30%; left: 3%; position: relative;">
    <ion-item>
      <ion-label position="floating">Name</ion-label>
      <ion-input (keyup)="updateInfo($event)"></ion-input>
    </ion-item><br>
    <ion-button color="primary" (click)="onSubmit()">Submit</ion-button>
  </div>
  <div style="position:relative; left: 3%; max-width: 30%;" *ngFor="let infoElement of infoElements">
    {{ infoElement.name }}
  </div>
  <div style="left: 2%; position:relative;">
  </div>
</ion-content>

However, the names that are properly printed are only ‘Justin’ and ‘Alfredo’
any other subsequent name inputs shows ‘[object KeyboardEvent]’ after clicking the Submit button.

I have tried searching for solutions online, like using {{ infoElement?.name }} and JSON.stringify() but no avail.

Posts: 1

Participants: 1

Read full topic


How to translate dynamic data using ng-translate

Past Toast and loadings shown if browser tab/app is reactivated

$
0
0

@warenli wrote:

Hi,

I am working with app which has many toast notifications. So every minute there can be few toasts displayed. When toasts were displayed and user is not actively using app/browser tab, toasts are not rendered in app. When he switches back to the app, toasts suddenly start appearing. It looks like ionic is delaying showing of the toasts if the current tab is not actively being used. It does not make sense to have this as default behaviour to me.

To reproduce see this Stackblitz https://stackblitz.com/edit/ionic-g5rt8f. The app shows 20 toasts in loop with some delay added between them.

  1. Open the app and notice that the toast is being displayed. Remember the toast that was displayed.
  2. Now switch to another browser tab and be there for couple of minutes.
  3. Switch back to Stackblitz tab. You will notice that the past toasts are being displayed to you now very quickly. This should not have happened.

The same issue happens with loaders as well. I keep seeing past loaders. I did not implement that here thinking that toast usecase should suffice to make the point.

Anybody come across such issue? Any idea what may be causing it inside Ionic?

Posts: 1

Participants: 1

Read full topic

Ionic native MArket plugin gives null value

$
0
0

@shashant28 wrote:

getting null value in an ionic3 native market plugin in ios. my code:
let appID = ‘’
if (this.networkProvider.networkStatus) {
if (this.platform.is(‘android’)) {
appID = ‘com.SHASHANT’;
} else if (this.platform.is(‘ios’)) {
//app id for ios is just for test
appID = ‘id586447913’;
}
this.market.open(appID).then(data => {
console.log("market open ", appID)
console.log("DATA for market open ", JSON.stringify(data))

  }).catch(err => {
    console.log("err in market open", err)
  })
}

Posts: 1

Participants: 1

Read full topic

view doesn't get update after input invalid format

$
0
0

@xiejiabao wrote:

I have the below code:

<ion-item>
    <ion-label floating>cdnum</ion-label>
    <ion-input type="number" [(ngModel)]="value"></ion-input>
</ion-item>

when I type multiple dash like ‘-----’ or other invalid formats like ‘1-1’ or ‘1.-3’, value is getting empty string but the typed characters still remain in the view.

For example, after typing ‘----------------’, the binding value is actually empty but the UI looks like this:
image

Is it a bug? How can solve it?

I test in ionic 3.9.2.

Posts: 1

Participants: 1

Read full topic

iOS simulator can't get the ionic device UUID

Firebase recaptcha working good in web but not working in ionic app why?.Any solution please let me know

Ionic 3 with storage

$
0
0

@harshm90 wrote:

I’ve tried to save my cart items in storage. At first it worked perfectly but suddenly when i tried again its throwing me an error this.cart.push() is not a function.

Unable to figure out what went wrong? Please help!!

this.storage.get('products').then((data) => {
      if (data == null) {
        data = [];
      }
      this.cart = data;       //re-initialize the items array equal to storage value
      this.cart.push(this.cartItem());
      return this.storage.set('products', this.cart);
    });

Posts: 3

Participants: 2

Read full topic


Best charting component for a hybrid app

$
0
0

@Nirmalya-S wrote:

What is the best charting component for a hybrid app? I already use Amchart but its too heavy for Mobile app. At least 7-8 MB apk size increase after build.

Posts: 1

Participants: 1

Read full topic

Ionic calendar issue

$
0
0

@ApproTechnologies wrote:

I did not get calendar
this is my code import { Component, OnInit } from ‘@angular/core’;
import { AlertController, NavController, ModalController } from ‘@ionic/angular’;
import { Calendar } from ‘@ionic-native/calendar/ngx’;
@Component({
selector: ‘app-calendar’,
templateUrl: ‘./calendar.page.html’,
styleUrls: [’./calendar.page.scss’],
})
export class CalendarPage implements OnInit {

public startDate; Date;
constructor(public alertController: AlertController, public navCtrl: NavController, public modalCtrl: ModalController, private calendar: Calendar) {
    
}

ngOnInit() {
}
leaves() {
this.navCtrl.navigateRoot(’/leaves’);
}
people() {
this.navCtrl.navigateRoot(’/people’);
}
approvals() {

    this.navCtrl.navigateRoot('/approvals');
}
notification() {

    this.navCtrl.navigateRoot('/notification');
}
opencal() {
    this.calendar.createCalendar('MyCalendar').then(
        (msg) => { console.log(msg); },
        (err) => { console.log(err); }
    );
    this.calendar.openCalendar(this.startDate)
}

}

My html code

    <ion-buttons slot="start">
        <ion-menu-button></ion-menu-button>
    </ion-buttons>
    <ion-title>
        Calendar
    </ion-title>
    <ion-buttons slot="secondary">
        <ion-button (click)="notification()">
            <ion-icon name="notifications"></ion-icon>
        </ion-button>
        <ion-button (click)="approvals()">
            <ion-icon name="list-box"></ion-icon>
        </ion-button>
        <ion-button  (click)="addEvent()">
            <ion-icon name="add"></ion-icon>
        </ion-button>
        
    </ion-buttons>
</ion-toolbar>
    <ion-segment-button value="calendar" class="active">
        <ion-icon name="md-calendar"></ion-icon>
    </ion-segment-button>

    <ion-segment-button value="Leaves" (click)="leaves()">
        <ion-icon name="paper-plane"></ion-icon>
    </ion-segment-button>
</ion-segment>

<button ion-button (click)=“opencal()”>Calendar

please help me to solve

Posts: 1

Participants: 1

Read full topic

Async Validation with Ionic 3 and firebase

TCP Client

Bitbucket connected to dashboard

$
0
0

@richarddeerflame wrote:

Hi guys. I have my bitbucket account connected in ionic dashboard. but now its not updating on my dashboard when i do a commit in bitbucket… It was updating a while back. what could be wrong?

Posts: 1

Participants: 1

Read full topic

Need solution for Ionic page with Tabs

$
0
0

@natarajamanis wrote:

Dear team,

Now I am developing the Ionic based application.

I had developed application for my Android, with the following Ionic configuration,

@Ionic\App script : 3.1.10
Cordova Platforms : Android 6.3.0
Ionic Framework : Ionic Angular 3.9.2
Ionic CLI Version : 3.20.0

In this I have faced some difficulties in the Ionic based application.

I need the answers for following questions.

  1. When I change the Tab , the next page is loaded normally.

    but When I programmatically get the page name , the result page instance is the previous one.

    how could is this possible ?

    I don’t know why it is happened ?

    kindly Advice me ? Am I doing any wrong way ?

Posts: 1

Participants: 1

Read full topic

[I4] Refresher not shown in content when used inside a component

$
0
0

@rodrigojrmartinez wrote:

Hi All,

I’m bulinding an ionic 4 app in which I have several pages which can refresh to update some data. For all pages the refresh functionality is the same. So, in order to save code I’ve isolated the ion-refresher component onto a component of my own which I could use on any page to be refreshed. The problem is When doing so the refresher is present but it isn’t shown over the ion-content tag. Basically what I did was;

refresher.component.html

<ion-refresher (ionRefresh)="doRefresh($event)">
    <ion-refresher-content refreshingSpinner="dots"></ion-refresher-content>
</ion-refresher>

Page component.html

<ion-content>
    <refresher-component></refresher-component>
    <ion-list>
       <ion-item>
            .... some content
       </ion-item>
    </ion-list>
</ion-content>

The resulting view isn’t the expected one, and the problem here as I understand is that the shadow dom that the ion-content generates, has a different style when pulling to refresh. Here on the screenshot below you can see how the inner div from the ion-content gets a translateY of 60px (this is added dynamically while pulling to refresh). Before, when setting the ion-refresher directly on the page component this didn’t happen when pulling to refresh.

Any hint on how could I solve this? Thanks a lot!

Posts: 1

Participants: 1

Read full topic


Ionic error connection refused (web page not available)

$
0
0

@sedar wrote:

Using command ionic cordova run android -l -c before android device was connected and working properly for testing in chrome developer tool. But now it is not running and showing error. May be due to latest upgrade to ionic cli 4. here is ionic info

Ionic:

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

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 6.4.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 6 other plugins)

System:

   ios-deploy : 1.9.4
   NodeJS     : v8.11.3 (/usr/local/bin/node)
   npm        : 5.6.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61```

**package.json**

“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”: “^5.0.0-beta.14”,
@ionic-native/fingerprint-aio”: “^5.2.0”,
@ionic-native/native-page-transitions”: “^5.2.0”,
@ionic-native/splash-screen”: “~4.18.0”,
@ionic-native/status-bar”: “~4.18.0”,
@ionic/storage”: “2.2.0”,
“chart.js”: “^2.7.3”,
“com.telerik.plugins.nativepagetransitions”: “0.6.5”,
“cordova-android”: “6.4.0”,
“cordova-plugin-add-swift-support”: “^1.7.2”,
“cordova-plugin-device”: “^2.0.2”,
“cordova-plugin-fingerprint-aio”: “^1.6.0”,
“cordova-plugin-ionic-keyboard”: “^2.1.3”,
“cordova-plugin-ionic-webview”: “^1.2.1”,
“cordova-plugin-splashscreen”: “^5.0.2”,
“cordova-plugin-statusbar”: “^2.4.2”,
“cordova-plugin-whitelist”: “^1.3.3”,
“ionic-angular”: “3.9.2”,
“ionicons”: “3.0.0”,
“rxjs”: “^6.0.0”,
“rxjs-compat”: “^6.4.0”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.26”
},
“devDependencies”: {
@ionic/app-scripts”: “3.2.3”,
@ionic/cli-plugin-cordova”: “1.6.2”,
@ionic/cli-plugin-ionic-angular”: “1.4.1”,
@ionic/lab”: “1.0.19”,
“typescript”: “~2.6.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-plugin-whitelist”: {},
“cordova-plugin-statusbar”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-keyboard”: {},
“cordova-plugin-fingerprint-aio”: {
“FACEID_USAGE_DESCRIPTION”: " "
},
“com.telerik.plugins.nativepagetransitions”: {},
“cordova-plugin-ionic-webview”: {}
},
“platforms”: [
“android”
]
}

![img](upload://aIwbPX2mEzg0R8W4zeYkTCjbeVP.png)

Posts: 1

Participants: 1

Read full topic

Styling properties not exposed as custom properties

$
0
0

@ollie-w wrote:

Seeing as all the components use shadow DOM, is it impossible to modify a style this isn’t exposed as a custom property?

Posts: 1

Participants: 1

Read full topic

Error in build: found version 4, expected 3

$
0
0

@leonjoo wrote:

Hi, in last July 2018 I’ve made a production build of my app ( ioniv v3).

These days I modified my app and I have to do the new build (android and Ios)
but I get a series of errors:
Error: Metadata version mismatch for module
/builds/project-0/node_modules/@ionic-native/core/decorators.d.ts, found version 4, expected 3
Error: Metadata version mismatch for module /builds/project-0/node_modules/@ionic-native/core/decorators.d.ts, found version 4, expected 3

Can i build on ionic pro dashboard my ionic v3 App?

Posts: 1

Participants: 1

Read full topic

Ionic4 use ion-item as button including ion-button

$
0
0

@mburger81 wrote:

We have a ion-list where we have a ion-item as button to benefice from to hover and ripple effect with an ion-avatar, ion-label and also with a ion-buttons element, this is our code:

<ion-list lines="none">
    <ion-item *ngFor="let user of users" (click)="doSelectUser(user)" button>
        <ion-avatar slot="start">
            <lan-text-avatar [text]="user.username"></lan-text-avatar>
        </ion-avatar>
        <ion-label>
            <h2>{{ user.username }}</h2>
            <!-- <p>{{ user }}</p> -->
        </ion-label>
        <ion-button color="danger" (click)="showRemoveAlert(user.username)" slot="end">
            <ion-icon slot="icon-only" name="trash"></ion-icon>
        </ion-button>
    </ion-item>
    <ion-item (click)="doSelectUser()" button>
        <!-- <ion-avatar slot="start">
            <ion-icon name="person-add" size="large"></ion-icon>
        </ion-avatar> -->
        <ion-icon name="person-add" slot="start"></ion-icon>
        <ion-label>
            <h2>{{ 'login.Select another user' | translate }}</h2>
        </ion-label>
    </ion-item>
</ion-list>

it looks like this
image

As you can see we have the button property on ion-item where we have also registered the click event. The ion-item has also a ion-button to remove an existing user with his own click event.

The problem is, clicking over the delete button performer both click event, that for the ion-item and also the ion-button one.

We can also remove the click event from ion-item and add one to ion-avatar and one to ion-label but in this case we have some space between the avatar and label where we can click on without perform the none of both click events.

So what is the best way to have an ion-list styled as button with different sub components like a dedicated ion-button but we have the ability to perform different click event without the problem of unrecognized space between some inner components.

We tried to pass for the ion-button click event the event and do the event.preventDefault() but there is no change, both click events are done.

Posts: 1

Participants: 1

Read full topic

How to overlap image on navbar ios

$
0
0

@pettrin wrote:

As everyone can see, in the top of the image has a blank bar status(white bar)

My question:

Its possible use my cover(image) over a bar status?

My code:

profile.ts

<ion-content *ngIf="showLogin == false" no-bounce class="bg-modal">
    <div class="header-image">
        <img src="../assets/imgs/Tkm-resources/Capa.png" onerror="this.src = '../assets/imgs/Tkm-resources/Capa.png'"/>
    </div>

    <div class="main-content" text-wrap text-center>

        <div class="circular">
            <img *ngIf="imgFacebook == null" no-border src="{{ usuario.usuario.avatar }}"
                 onerror="this.src='../../assets/imgs/person-flat.png'" (click)="changePicture()"/>
        </div>
        <h6 no-margin padding-top>{{ usuario.usuario.nome }}</h6>
        <span color="ticket-grey">{{ usuario.usuario.email }}</span>

        <div>
            <ion-row margin-bottom margin-top padding-top (click)="onClickEditProfile()">
                <ion-icon name="ios-contact" item-left color="primary"></ion-icon>
                <span margin-left> Editar informaçōes pessoais</span>
            </ion-row>

            <ion-row margin-bottom margin-top (click)="onClickAlterPassword()">
                <ion-icon name="ios-build" item-left color="primary"></ion-icon>
                <span margin-left> Alterar senha</span>
            </ion-row>

            <ion-row margin-bottom margin-top (click)="onClickOpenPedidos()">
                <ion-icon name="ios-pricetags" item-left color="primary"></ion-icon>
                <span margin-left> Meus Pedidos</span>
            </ion-row>

            <ion-row margin-bottom margin-top (click)="onClickShowFavorit()">
                <ion-icon name="ios-heart" item-left color="primary"></ion-icon>
                <span margin-left> Meus eventos favoritos</span>
            </ion-row>

            <ion-row margin-bottom margin-top (click)="onClickOpenCall()">
                <ion-icon name="ios-information-circle" item-left color="primary"></ion-icon>
                <span margin-left> Precisa de ajuda?</span>
            </ion-row>

            <ion-row margin-bottom margin-top (click)="onClickSetIndicate()">
                <ion-icon name="ios-thumbs-up" item-left color="primary"></ion-icon>
                <span margin-left> Indicar aplicativo</span>
            </ion-row>

            <ion-row margin-top  (click)="onClickLogout()">
                <ion-icon name="ios-exit" item-left color="primary"></ion-icon>
                <span margin-left> Deslogar</span>
            </ion-row>
        </div>
    </div>
</ion-content>

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>