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

Ionic 4.0.0 Beta 3 -- Ion-icons not appearing

$
0
0

@mlynch wrote:

As the title says, I’m running Ionic v4.0.0 Beta 3, and I’m having an issue with <ion-icon> elements not appearing properly.

When I compile the application and run it on my Android tablet (Android 8.0.0), I see that the element does exist in the HTML, and there is space in the UI where the element should appear, but the icon itself simply doesn’t appear. If I set the <ion-icon> element’s background color, that appears just fine, but still no icon.

Posts: 1

Participants: 1

Read full topic


Modal component is not assignable to parameter of type 'ModalOptions'

$
0
0

@maxg86 wrote:

Hello , I’m trying to display a modal in a ionic 4 / angular app but the ModalController create function wont take components as first parameter, I’m passing the reference of a component class like in all examples I found but I get the following error in the console :
[ng] ERROR in src/app/pages/factures/factures.page.ts(90,55): error TS2345: Argument of type ‘typeof FacturePaiementComponent’ is not assignable to parameter of type ‘ModalOptions’.
[ng] Property ‘component’ is missing in type ‘typeof FacturePaiementComponent’.

The v3.9.2 API docs doesn’t seem compatible with v4 modal so I’m struggling.

Which reference should I pass ? and btw when I pass a second parameter as data to ModalController.create() it doesn’t accept it, how can I pass data to modal in v4?

code :
Here is the function where I call my modal in a page component :

import {Component, OnInit} from '@angular/core'
import { ModalController, NavParams } from '@ionic/angular';
import {DataService} from '../../services/data.service'
import * as moment from 'moment'
import {Facture} from '../../models/facture'
import {FacturePaiementComponent} from './facture-paiement/facture-paiement.component'

@Component({
  selector: 'app-factures',
  templateUrl: './factures.page.html',
  styleUrls: ['./factures.page.scss'],
})
export class FacturesPage implements OnInit {

  public detailsToggle = false
  public paiementToggle = false


  constructor(public service: DataService, public modalCtrl: ModalController) {
  }

ngOnInit() {
    ...
  }

  togglePaiement(facture: Facture) {
    this.presentPaiementModal(facture)
  }

  async presentPaiementModal(facture: Facture) {
    const paiementModal = await this.modalCtrl.create(FacturePaiementComponent);
    return await paiementModal.present();
  }
}

Here is the modal component :

import {Component, Input, OnInit} from '@angular/core'
import {NavParams} from '@ionic/angular'
import {Facture} from '../../../models/facture'

@Component({
  selector: 'facture-paiement',
  templateUrl: './facture-paiement.component.html',
  styleUrls: ['./facture-paiement.component.scss']
})
export class FacturePaiementComponent implements OnInit {

  constructor(public params: NavParams) {
    console.log('facture', params.get('facture'));
  }

  ngOnInit() {
  }
}

Thanks in advance,
Max

Posts: 2

Participants: 2

Read full topic

Help Setting up Environment for Old Project (2.0.0-beta.11)

$
0
0

@evandillon wrote:

Like the title says, I have a project build on “ionic-angular”: “2.0.0-beta.11”. I imagine I have to install Ionic cli locally but am having a hard time finding the appropriate version of that package. Either the install fails completely or I get a bunch of incompatibility warnings.

Upgrading is not an option at this point.

Can anyone guide me in the way a project like this should be set up?

Many thx,

Posts: 2

Participants: 2

Read full topic

How to print QRcode with thermal printer.?

Android CORS issue when using fetch

$
0
0

@NorthFred wrote:

I just started a new project, in which I am reusing a component I used earlier in another Ionic v3 project. No modifications were done to the code.

The “fetch” simply gets a json from a server (not mine, operator ftp server), and my previous project can fetch that json without problem. Now the same code, used in a new project, is throwing a CORS error whenever I deploy my test app to Android.

Any clues as to what might be going wrong?

The only plugin I saw, which might have an effect on the fetch, is cordova-plugin-ionic-webview 3.1.1

Part of the code:

await fetch(CHANNELSURL, {
      method: 'GET',
      headers: {
        'Accept': 'application/json, text/plain',
        'Content-Type': 'application/json, text/plain',
        'Cache-Control': 'no-cache',
        'Save-Data': 'off',
        'Connection': 'close'
      }
    })
    .then(response => {
      return response.json();
    })

Posts: 1

Participants: 1

Read full topic

Please help ionic4 issue with ios simulator

$
0
0

@abbashere wrote:

Facing issue last 2 days not any solution tried many things

node v10.15.0
ionic version 4.8.0
Cordova Platforms : android 7.1.4, ios 4.5.5
macOS Mojave

issue with sidebar ionic project with below run

ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"

simulator able to open without app and then got below error

No target specified for emulator. Deploying to iPhone-X, 12.1 simulator

io.ionic.starter: 40545

Error: ENOENT: no such file or directory, stat '/Users/myusername/Library/Logs/CoreSimulator/64FD3BE7-2F30-4DFE-8509-C9431C6B6C78/system.log'

[ **ERROR** ] **An error occurred while running subprocess** **cordova** **.**

Posts: 1

Participants: 1

Read full topic

Enable a ion-button after some time

$
0
0

@blondie63 wrote:

On my page i’ve a button and i want that it’s disabled by default, but, after 30 seconds my page is open, this button become enabled

Someone can help me ? :slight_smile:

Posts: 1

Participants: 1

Read full topic

Ionic 4 (and Ionic CLI 4.9) released! 🎉

$
0
0

@Sujan12 wrote:

Oh, see what my Ionic release bot just tweeted:

https://github.com/ionic-team/ionic/releases/tag/v4.0.0 says:

4.0.0 Neutronium
Enjoy! :balloon:

And here is the official tweet:

And blog post:

https://blog.ionicframework.com/introducing-ionic-4-ionic-for-everyone/

Whee!

Posts: 4

Participants: 3

Read full topic


Bring back the v3 docs

`ion-scroll` dynamic height

$
0
0

@Eric_Horodyski wrote:

I have an app where the design is similar to AirBNB, where there are multiple horizontal scrolling inifinite-loading lists.

Unfortunately, when using <ion-scroll scrollX="true">, I am unable to get the content that resides within to display unless specifically set a height value (height: auto doesn’t work):

<ion-content>
    <ion-scroll scrollX="true">
        <div *ngFor="let item of items">
            <h1>{{item}}</h1>
        </div>
    </ion-scroll>
</ion-content>

Am I missing something here, or is the only way to set the height I need will be through making a reference to the child element, get it’s height, and set the <ion-scroll> height through the component’s code?

Posts: 1

Participants: 1

Read full topic

Add input inside actionsheet ionic-v4 beta

$
0
0

@Quouhadiho wrote:

Can anyone help me.
I’m trying to use ionic-v4 beta and I want to add an ion-input inside an actionSheetController.
Any answer will be helpful for me.

Posts: 4

Participants: 2

Read full topic

Show and Hide div - Ionic 4

$
0
0

@julianacristina8 wrote:

Hi, anyone can help me with that? I need to hide and show one div with the click of the button, I tried some things, but didn’t work.
Thanks.

Posts: 1

Participants: 1

Read full topic

Android build --device ERR_FILE_NOT_FOUND

$
0
0

@mmccorkleedibu wrote:

I’m getting a white screen on Android 5.x when using ionic cordova run android --device. Using the live reload -l works but is very slow and intermittently working. I usually get a connection error before the screen display.

runtime.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
styles.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
polyfills.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
cordova.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
vendor.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
main.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
/assets/icon/favicon.png:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

Posts: 1

Participants: 1

Read full topic

Scroll up to hide search bar

$
0
0

@dccil wrote:

I have a page where when you pull the page down, a search bar will show up. This works out well, however, I would like to add the functionality of scrolling the page up to hide to search bar. I also noticed that I am unable to scroll the page when searching or even after the search or cancel the search. How can I cancel the search and hide the search bar?

page.html

  <ion-refresher (ionRefresh)="doRefresh($event)"><ion-searchbar [(ngModel)]="searchInput" (ionInput)="getItems($event)"></ion-searchbar></ion-refresher>
    <ion-list *ngIf="searchInput !== ''">
      <ion-item *ngFor="let item of items" (click)="navToSearchedProfile(item._id)">
        {{ item.profile_name }}
      </ion-item>
    </ion-list>

page.ts

export class Page {

  searchQuery: string = '';
  items = [];
  profiles: any;
  searchInput='';
  _id: any=[];

  constructor(public navCtrl: NavController,
              public navParams: NavParams,
              public db: Database) {
                  this.db.read().then(data => {
                    this.profiles = data;
                    this.initializeItems();
                  });
                }

//search bar
  doRefresh(refresher) {
    console.log('Show Searchbar', refresher);
  }

  initializeItems() {
    this.items = this.profiles;
  }

 getItems(ev) {
    this.initializeItems();
    var val = ev.target.value;
    if (val && val.trim() != '') {
      this.items = this.items.filter((item) => {
        return (item.profile_name.toLowerCase().indexOf(val.toLowerCase()) > -1);
      })
    }
  }

  navToSearchedProfile(_id){
    this.navCtrl.push(ProfilePage, {_id: _id});
  }
//end search

Posts: 1

Participants: 1

Read full topic

Ionic 4 - Create PDF

$
0
0

@vvanherk wrote:

Hello.

I’m looking for examples and API suggestions for creating PDF files based off the data in my Ionic 4 application.

I’ve seen a popular example (link below):

However, it is based off Ionic 3 - so not sure it will work…

Any input appreciated.
Cheers.

Posts: 1

Participants: 1

Read full topic


Apple Rejecting Ionic Apps

$
0
0

@bensearle wrote:

Apple rejected my app for 3 reasons, 2 of which are due to it being designed for an iPhone and not scaling up well for an iPad.

The third is more concerning - because I use web views and not native buttons. i.e. because I am using Ionic. Has anyone else had this problem or have any idea of how I should progress?

ionic-angular: 3.9.2
Native packages: admob-plus, google-maps, social-sharing, status-bar, splash-screen

Rejection message from Apple:

Guideline 4.0 - Design

We noticed several issues in your app that contribute to a lower quality user experience than Apple users expect, such as:

  • Your app included low resolution or jagged images.

  • Your app included hard to read type or typography.

  • Your app did not include iOS features. App Store apps should use native iOS buttons and include iOS features other than just web views, push notifications, or sharing.

These examples identify the types of issues discovered in your app but may not represent all such issues.

Posts: 1

Participants: 1

Read full topic

Data gets duplicated on screen when using *ngFor and in an

$
0
0

@doron wrote:

This is an Ionic-4 problem.

When using *ngFor inside an <ion-item> which is inside an <ion-list> – all works fine: items are enumerated properly.

But now when using the same *ngFor loop but inside of an <ion-item-sliding> (which is inside of an <ion-item-group> that in turn is inside an <ion-list>) the entire item group is repeated exactly twice, i.e. all items show up twice – with the same <ion-item-divider> and exactly the same content: once at the top of the content area and another time half way down, basiically the content area is split into two halves: a top half and a bottom half and the list appears exactly as it should, but twice - once in the top half and another in the bottom half.

This is very strange…

I tried going back to simple <ion-item> and no problem at all - works perfectly.

I also verified that my input to the template (the array entries in the *ngFor) is exactly what it should be - it is: the content is not duplicated in any way inside entries and entries is exactly what should it be, but its content is duplicated on the screen).

Here’s the relevant template code that did not work:

<ion-content *ngIf="directoryEntry.fullPath">
    <ion-grid size="fixed">
        <ion-list>
            <ion-item-group>
                <ion-item-divider sticky>
                    <ion-label>
                        In folder: {{ directoryEntry.fullPath | pathPipe }}
                    </ion-label>
                </ion-item-divider>
                <ion-item-sliding *ngFor="let entry of entries">
                    <ion-item ion-button detail="false"
                              (click)="onClickItem($event, entry)">
                        <ion-label>
                            <ion-row align-items-stretch>
                                <ion-col size="auto" align-self-center
                                         *ngIf="entry.selected">
                                    <ion-icon [name]="icon.selected">
                                    </ion-icon>
                                </ion-col>
                                <ion-col size="auto" align-self-center
                                         *ngIf="!entry.selected">
                                    <ion-icon [name]="icon.unselected">
                                    </ion-icon>
                                </ion-col>
                                <ion-col size="auto" align-self-center>
                                    <ion-icon [name]="entry.icon"></ion-icon>
                                </ion-col>
                                <ion-col size="9.7" align-self-center>
                                    {{ entry.displayName || entry.name }}
                                </ion-col>
                            </ion-row>
                        </ion-label>
                    </ion-item>
                    <ion-item-options side="end">
                        <ion-item-option>
                            <ion-icon name="md-create"></ion-icon>
                            &nbsp;
                            Rename
                        </ion-item-option>
                    </ion-item-options>
                </ion-item-sliding>
            </ion-item-group>
        </ion-list>
    </ion-grid>
</ion-content>

NOTE: for reference, here’s template code that did work when using simple items (instead of sliding items inside of an item group as above). The code above shows duplicate content, as described, but the code below does not:

<ion-content *ngIf="directoryEntry.fullPath">
    <ion-grid size="fixed">
        <ion-list>
           <ion-item *ngFor="let entry of entries"
                ion-button detail="false" 
                (click)="onClickItem($event, entry)">
                <ion-label>
                    <ion-row align-items-stretch>
                        <ion-col size="auto" align-self-center
                                 *ngIf="entry.selected">
                            <ion-icon [name]="icon.selected">
                            </ion-icon>
                        </ion-col>
                        <ion-col size="auto" align-self-center
                                 *ngIf="!entry.selected">
                            <ion-icon [name]="icon.unselected">
                            </ion-icon>
                        </ion-col>
                        <ion-col size="auto" align-self-center>
                            <ion-icon [name]="entry.icon"></ion-icon>
                        </ion-col>
                        <ion-col size="9.7" align-self-center>
                            {{ entry.displayName || entry.name }}
                        </ion-col>
                    </ion-row>
                </ion-label>
            </ion-item>
        </ion-list>
    </ion-grid>
</ion-content>

Has anybody seen a similar problem? Is this a bug in Ionic4?

Thanks for any leads!

Posts: 2

Participants: 1

Read full topic

Ionic windows build high CPU usage

$
0
0

@cristopherdino wrote:

Hello,
We are having performance issue in our ionic UWP app. After adding and successfully build the app in windows platform. We noticed that the app consume too much CPU just by moving the mouse around the application which performance issue. The app is too slow, hangs and completely unusable.

To investigate, we run the app on Visual Studio analyzer. The screenshot below is the result and as you’ll notice the build is adding DOM event named “pointermove” on very element on the app. It is also clear from the screenshot that this event causes high CPU performance.

How can we solve this? has any of you encounter the same problem? are there any solution?

Posts: 1

Participants: 1

Read full topic

How to pass data to other pages in #Ionic4

$
0
0

@TechCreationZ wrote:

I am working on a Ionic 4 Android app. I want to pass data to other pages. So, How can I do that?
(Other information can be given…)

Posts: 1

Participants: 1

Read full topic

Help, IONIC 4 - ANGULAR 7

$
0
0

@devCODITRON wrote:

HELP:: IONIC 4 - ANGULAR 7 (.apk simple demo)

  • ionic start myApp tabs --type=angular
  • cd myApp
    (config.xml :: )
  • ionic cordova platform add android
  • ionic cordova build android

  • I install the apk
  • When you open the app only the splash appears a few seconds later it goes blank.
    The same with the app I was doing.

IS SOMETHING MISSING OR THAT WITH IONIC VERSION 4?

.

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>