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

Object properties

$
0
0

@user1111 wrote:

I want to display to template all exists properties of object, but can’t retrieve it:

import { Device } from ‘@ionic-native/device/ngx’;

constructor(private device: Device,

ngOnInit() {
console.log( this.device ); //dislpay as expected: Device cordova, model, etc…
console.log( Object.getOwnPropertyNames(this.device) ); //but here Array(0)
console.log( Object.keys(this.device) ); // and here Array(0)

}

but this iterations like this, works:

let result: object = {};
for(let v in this.device) {
result[v] = this.device[v];
}

My question.
Why calls getOwnPropertyNames, keys return empty data?

2018-12-28_1854

Posts: 1

Participants: 1

Read full topic


Launch icon width problem

Ionic iOS - HTML videos go black after reproducing a few

$
0
0

@pirusta wrote:

I’m building an app in which the user reproduces several html5 videos in different components as the pageflow advances. The mp4 sources of the videos come from the local file system.

Everything is working nicely on a web version I deployed on a server and people are using with Chrome.

However in iOS, after reproducing approximately 18 of these videos, ALL the videos stop working and just black box shows up. (I was able to reproduce it on an iPad 3 and 4)
Any ideas of what may be causing this? I have the feeling it must have something to do with some kind of Cache / Memory, because the problem only appears after an approximate amount of videos are reproduced. Also, the videos are playable again after I close and re-open the app.

I will try to see if it has something to do with files but I’m not feeling very lucky with this approach.

My versions:
Ionic: 3.9.2
Angular: 5.2.9

Posts: 1

Participants: 1

Read full topic

Customizing ion-fab

$
0
0

@Llarian wrote:

Hi,

I want to style my fab button.
So, in my template I have

<ion-fab bottom right>
  <button ion-fab background="getFabGradient()" >
    <ion-icon name="add"></ion-icon>
  </button>
[...]
</ion-fab>

this works when

  getFabGradient() { 
    return "linear-gradient(darkorange, orange, green, darkblue, red)";
  }

It does not work when

  getFabGradient() { 
    return "conic-gradient(darkorange, orange, green, darkblue, red)";
  }

Why does the first work and the second doesn’t??
How do I get my conic gradient?

regards

Posts: 1

Participants: 1

Read full topic

Supported Node version

$
0
0

@lqrz wrote:

What is the latest supported Node version for Ionic 3? The installation docs say " Please make sure latest Node 6 LTS and NPM 3+ are installed.". Is this outdated? Does it mean I cannot use a Node version above v6 (e.g. the latest Node v10.15) ?
Thanks!

Posts: 1

Participants: 1

Read full topic

Have any experienced Ionic developers run through the v4 getting started tutorial?

$
0
0

@rtpHarry wrote:

Has anyone run through the recently released tutorial at:

It had a few issues where it referred to incorrect pages, which I opened PR requests for (https://github.com/ionic-team/ionic-docs/pull/243) but I have got stuck now.

I am on the second page (https://beta.ionicframework.com/docs/developer-resources/guides/first-app-v4/ios-android-camera/) to the point where it tells me to launch it in DevApp and try taking a photo. I only get cordova_not_available no matter what I try.

I tried rolling the camera plugin and friends back to Beta 20 after following one thread saying there are issues.

I tried installing the ionic cordova platform add android which it lists as a later step in case the writer hadn’t realised it was required earlier - I thought maybe they already had it installed which is hard to catch these things.

It’s just not working for me.

λ ionic info

Ionic:

   ionic (Ionic CLI)             : 4.6.0 (C:\Users\rtpha\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.0
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 5 other plugins)

System:

   NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

Posts: 1

Participants: 1

Read full topic

Create Navigation using GPX File Format

$
0
0

@wibits wrote:

Hi,

I want to do smooth navigation using GPX file format. Can we do this in ionic3? If so can you please give me any reference?

Thanks

Posts: 1

Participants: 1

Read full topic

Ionic native media


Ionic 4 SCSS Issue

$
0
0

@flycoders_sourav wrote:

Hi developers, I am facing a problem regarding scss .I tried to change some custom desing in my .scss file after change my Scss nothing happen. please can you tell how can i fix that in ionic 4
Thanks in advance
Please help me out.

Posts: 3

Participants: 2

Read full topic

Cannot read property 'trim' in ion-searchbar

$
0
0

@ziaionic wrote:

Hi everyone
in ionic 3
I am using ion-searchbar to search inside array named offers
everything is good but if I cancel (click on X icon) shows me this error.
ERROR TypeError: Cannot read property 'trim' of undefined
this is my code:

.html
<ion-searchbar platform="ios" (ionInput)="getItems($event)" (ionCancel)="onCancel($event)"></ion-searchbar>

.ts
 getItems(ev: any) {
    const val = ev.target.value;

      if (val.trim() !== '') {
        this.offers = this.offers.filter((item) => {
          return item.title.toLowerCase().indexOf(val.toLowerCase()) > -1 || item.description.toLowerCase().indexOf(val.toLowerCase()) > -1;
        })
    }
  }
  onCancel(ev:any){
    console.log("canceled.",ev)
  }

Posts: 1

Participants: 1

Read full topic

[ionic 4] - how to scroll content?

Error while creating weather app WeatherProvider

$
0
0

@kirannair123 wrote:

Runtime Error
Can’t resolve all parameters for WeatherProvider: (?).

Please help me how to resolve this error

Posts: 1

Participants: 1

Read full topic

AppAvailability not working on Android for com.facebook.katana

$
0
0

@wwwguy wrote:

For some reason AppAvailability it isn’t working on Android for detecting the installed Facebook app on the device. The test fails every time, even though the FB app is installed?

constructor(private appAvailability: AppAvailability) {

this.appAvailability.check(‘com.facebook.katana’).then(
() => { // success callback
console.log(‘TEST success: com.facebook.katana’);
},
() => { // error callback
console.log(‘TEST error: com.facebook.katana’);
}
);

}

Posts: 1

Participants: 1

Read full topic

Ionic 4 rc importing problem

$
0
0

@pabloo87 wrote:

Hi, i installed ionic 4 rc and i having troubles to migrate. I copied the src carpet to the new project and after installing the plugins the project throw error when serving. When i see the project on the IDE i see problems with importing e.g.:

import { Slides } from ‘@ionic/angular’;

The IDE says that Slides has no exported members. Maybe @ionic/angular changed in the last upgrade :thinking:

Posts: 1

Participants: 1

Read full topic

Mac ionic fails with Check your ANDROID_SDK_ROOT value

$
0
0

@elduderino15 wrote:

Trying to emulate Android device on my Mac 10.14.2 with:

export ANDROID_HOME=/Users/me/Library/Android/sdk
export ANDROID_SDK_ROOT=/Users/me/Library/Android/sdk
export ANDROID_AVD_HOME=/Users/me/.android/avd

ionic cordova run --confirm --no-interactive --emulator android

but it fails with:

PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/Users/me/Library/Android/sdk]!

All the specified paths are in fact the default paths after installation. I did not change anything. system-images contains images to 5 android versions I installed through android studio.

sdk $ l /Users/me/Library/Android/sdk
build-tools/    extras/         licenses/       platform-tools/ sources/        tools/
emulator/       fonts/          patcher/        platforms/      system-images/


sdk $ l system-images/
android-23/     android-24/     android-25/     android-26/     android-27/     android-28/

Any advice on how to properly fix the failing build?

ionic info

Ionic:

   ionic (Ionic CLI)  : 4.5.0 (/Users/me/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 9 other plugins)

System:

   ios-deploy : 1.9.4
   NodeJS     : v11.4.0 (/Users/me/.nvm/versions/node/v11.4.0/bin/node)
   npm        : 6.4.1
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

Posts: 1

Participants: 1

Read full topic


Image drag and resize

$
0
0

@YousefRabieKhalil wrote:

Hey all
I’m trying to accomplish this tasks
Give the user the ability to drag image and resize the image (change image width and height) using the mobile touch without crop the image
Any help in this?!!

Posts: 1

Participants: 1

Read full topic

File upload v-4

Ionic 4 Virtual scroll with wrapping items for large screens

$
0
0

@peterjc wrote:

I am revisiting the Virtual scroll in Ionic 4, to see if I can now get it to do what I have always been after.

I have a list (which can be very large, depending on server data), so I want it to be virtual. Also, on larger screens, I would like to display 2 (or perhaps 3) items side be side, rather than a single column (which is what we want for phone size screen in portrait).

I have the following setup…

<ion-content padding>
  <ion-virtual-scroll  [items]="items" approxItemHeight='40px'>
    <ion-item id='outer' *virtualItem="let item">
     <div id='container'>
      <ion-img style="margin-right:10px" [src]="item.img"></ion-img>
      <div style='display:grid'>{{item.text}}</div>
     </div>
    </ion-item>
  </ion-virtual-scroll>
</ion-content>

And in the scss…

#container{
  display: grid;
  grid-template-columns: 30px auto ;
  grid-template-rows: 40px;
  justify-items: center;
  background: lightblue;
  width: 100%;
}

#outer{
  display :grid;
  grid-template-columns: stretch ;
}

@media screen and (min-width: 800px) {
  #outer{
    grid-template-columns: 50% 50%  ;
  }
}

So I have set the #outer id to each of the ion-item, and then use the media query to adjust the widths.

I have also tried with just floats widths etc rather than css grid, but nothing seems to get them to move up so more than one on each row,

I see the widths adjusting as expected as I resize the browser window…

But my items are not wrapping.

Does anyone know if this is possible, and if so, how I can do this?

Thanks in advance!

Posts: 1

Participants: 1

Read full topic

Sidemenu navigation icon disappears while navigating to another page?

$
0
0

@sedar wrote:

app.component.ts

import { Component, ViewChild } from '@angular/core';
import { Platform, Nav,App, AlertController,NavController,NavParams } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { LoginPage } from '../pages/login/login'
import { HomePage } from '../pages/home/home';
import { LocationChangePage} from '../pages/location-change/location-change';

@Component({
    templateUrl: 'app.html'
})
export class MyApp {
     @ViewChild(Nav) nav: NavController;
    rootPage: any = LoginPage;

    pages: Array<{ title: string, component: any }>;

    constructor(public platform: Platform,
         statusBar: StatusBar,
         public alertCtrl: AlertController,
         public app: App,
         splashScreen: SplashScreen) {
        platform.ready().then(() => {
        statusBar.styleDefault();
            splashScreen.hide();
            platform.registerBackButtonAction(() => {

                let nav = app.getActiveNavs()[0];
                let activeView = nav.getActive();

                if (activeView.name === "HomePage" || activeView.name === "LoginPage") {

                    if (nav.canGoBack()) { //Can we go back?
                        nav.pop();
                    } else {
                        const alert = this.alertCtrl.create({
                            title: 'Close App',
                            message: 'Do you want to exit?',
                            buttons: [{
                                text: 'Cancel',
                                role: 'cancel',
                                handler: () => {
                                    console.log('Application exit prevented!');
                                }
                            }, {
                                text: 'Close App',
                                handler: () => {
                                    this.platform.exitApp(); // Close this application
                                }
                            }]
                        });
                        alert.present();
                    }
                }
            });
        });
        this.pages = [
            { title: 'Stock In', component: HomePage },
            { title: 'Change Rack/Bin ', component: LocationChangePage }
        ];
    }
    openPage(page) {
        console.log('page component'+page.component);
        this.nav.push(page.component);
    }
}

app.html

<ion-menu [content]="content" enable-menu-with-back-views="true">
    <ion-header>
      <ion-toolbar>
        <ion-title>Menu</ion-title>
      </ion-toolbar>
    </ion-header>
  
    <ion-content>
      <ion-list>
        <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
          {{p.title}}
        </button>
      </ion-list>
    </ion-content>
  
  </ion-menu>
  
  <!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
  <ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>

sidemenu icon disappears after navigation.?

Posts: 1

Participants: 1

Read full topic

Ionic 3 unshift to array change the scroll position

$
0
0

@avishai_peretz_dev wrote:

I have an chat app, When the page is init i load last 10 messages and when the user scroll top i loading async previous messages and unshift the previews message to the ngFor array.
The problem is when the items are unshift the scroll change.
How can i keep the scroll on same position?

Posts: 1

Participants: 1

Read full topic

Viewing all 48984 articles
Browse latest View live


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