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

Ionic 4 - must be a rtl/ltr bug? (MULTI LANGUAGE APP)

$
0
0

### THIS MUST BE A BUG!!

Global.SCSS BASED ON RTL OR LTR DOES NOT WORK!!
In my case it is very simple if i use RTL i would like to have use RTL style located in global.scss.
Like Ionic 3. But this does not work for me. I migrated to ionic 4 and getting stuck with this problem.

[dir="ltr"] {
  ion-button {
    //My style for LTR
  }
}
[dir="rtl"] {
  ion-button {
   //My style for RTL
  }
}

I trying to change the direction based on what i have choice in my language service variable set. (RTL or LTR) in my ion-header or ion-content .
Have tried code above in global.scss. But only work if you have the direction in index.html.

The global style does not care only look at index.html direction it does not care about my home.page.html if i have put dynamic direction

It always look at index.html . and take the direction from there and use that style that is set there.
([dir=“rtl”] ); --> look only in index.html can not figure out how to fix this.

Is there no fix for this yet? I would like to have the direction based on what language i choice,
In my case i have 2 diffrent styles one for LTR and one for RTL .

Is there any solution for this?

I have post this on github also as a comment… hope everybody can see it.


Plugins native error: Object(…) is not a function

$
0
0

Some examples of plugins that dont work:

First of all here is my module.app where is all my plugins:

import { BrowserModule } from ‘@angular/platform-browser’;
import { ErrorHandler, NgModule } from ‘@angular/core’;
import { IonicApp, IonicErrorHandler, IonicModule, Select } from ‘ionic-angular’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { SQLite } from ‘@ionic-native/sqlite’;
import { HttpModule } from ‘@angular/http’;
import { File } from ‘@ionic-native/file’;
import { FilePath } from ‘@ionic-native/file-path/ngx’;
import { FileChooser } from ‘@ionic-native/file-chooser/ngx’;
import { IOSFilePicker } from ‘@ionic-native/file-picker/ngx’;
import { FileOpener } from ‘@ionic-native/file-opener/ngx’;
import { Device } from ‘@ionic-native/device’;
import { BarcodeScanner } from ‘@ionic-native/barcode-scanner’;
import { BluetoothSerial } from ‘@ionic-native/bluetooth-serial’;
import { BLE } from ‘@ionic-native/ble’;
import { AnimationService, AnimationBuilder } from ‘css-animator’;
import { SignaturePadModule } from ‘angular2-signaturepad’;
import { Geolocation } from ‘@ionic-native/geolocation/ngx’;
import { LaunchNavigator } from ‘@ionic-native/launch-navigator/ngx’;
import { Base64 } from ‘@ionic-native/base64/ngx’;

import { MyApp } from ‘./app.component’;
import { FirmarPage } from ‘…/pages/firmar/firmar’;

import { BaseDatos } from ‘…/providers/basedatos’;
import { FuncionesGlob } from ‘…/providers/funciones’;
import { Babel } from ‘…/providers/babel’;
import { OpcionesAvanzadas } from ‘…/providers/opciones-avanzadas’;
import { Sincronizacion } from ‘…/providers/sincronizacion’;

@NgModule({
declarations: [
MyApp,
FirmarPage
],
imports: [
BrowserModule,
HttpModule,
SignaturePadModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
FirmarPage
],
providers: [
AnimationService,
AnimationBuilder,
StatusBar,
SplashScreen,
SQLite,
File,
FilePath,
FileChooser,
IOSFilePicker,
FileOpener,
Device,
BarcodeScanner,
{provide: ErrorHandler, useClass: IonicErrorHandler},
BaseDatos,
FuncionesGlob,
Babel,
OpcionesAvanzadas,
Sincronizacion,
Select,
BluetoothSerial,
BLE,
Geolocation,
LaunchNavigator,
Base64
]
})
export class AppModule {}

the plugin that include /ngx are the plugins that dont work but i have to add this to the aplication compile without errors.

Then I used it like other plugins (also before updatings or somthing the plugins didnt need the /ngx and everything works perfectly)

Examples that not working to me:

import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams, LoadingController, PopoverController, ModalController, ActionSheetController } from ‘ionic-angular’;
import { Geolocation } from ‘@ionic-native/geolocation/ngx’;
import { LaunchNavigator, LaunchNavigatorOptions } from ‘@ionic-native/launch-navigator/ngx’;
//import { AnimationService, AnimationBuilder } from ‘css-animator’
//import { MenuCuentaPage } from ‘…/menu-cuenta/menu-cuenta’;

import { FuncionesGlob } from ‘…/…/providers/funciones’;
import { BaseDatos } from ‘…/…/providers/basedatos’;
import { Babel } from ‘…/…/providers/babel’;
import { Sincronizacion } from ‘…/…/providers/sincronizacion’;

import { Intervencion } from ‘…/…/models/intervencion’;
import { Aparato } from ‘…/…/models/aparato’;
import { Estado } from ‘./…/…/models/clases’;

@IonicPage()
@Component({
selector: ‘page-intervenciones’,
templateUrl: ‘intervenciones.html’,
})
export class IntervencionesPage {

constructor(public loadingCtrl: LoadingController, private modalCtrl: ModalController, public navCtrl: NavController, public navParams: NavParams, private popoverCtrl: PopoverController, public funciones: FuncionesGlob, public basedatos: BaseDatos, public babel: Babel, public actionSheetController: ActionSheetController, public sincronizacion: Sincronizacion,private launchNavigator: LaunchNavigator, public geolocation: Geolocation) {


navigateLocation(direccionDestino: string, descripcionDestino: string) {


//THIS GIVEME THE ERROR 'Object(…) is not a function
this.launchNavigator.navigate(direccionDestino, options)
.then(success => {
console.log(success);
}, error => {
console.log(error);
})

}

another example of my code:

import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams, ViewController } from ‘ionic-angular’;
import { BaseDatos } from ‘…/…/providers/basedatos’;
import { FuncionesGlob } from ‘…/…/providers/funciones’;
import { Babel } from ‘…/…/providers/babel’;

import { FilePath } from ‘@ionic-native/file-path/ngx’;
import { FileChooser } from ‘@ionic-native/file-chooser/ngx’;
import { IOSFilePicker } from ‘@ionic-native/file-picker/ngx’;
import { FileOpener } from ‘@ionic-native/file-opener/ngx’;
import { Base64 } from ‘@ionic-native/base64/ngx’;
import { Platform } from ‘ionic-angular’;
import { DomSanitizer } from ‘@angular/platform-browser’;
import { Documento } from ‘…/…/models/clases’;
import { Sincronizacion } from ‘…/…/providers/sincronizacion’;

@IonicPage()
@Component({
selector: ‘page-documentos’,

templateUrl: ‘documentos.html’,

constructor( public navCtrl: NavController, public navParams: NavParams, private viewCtrl: ViewController, private basedatos: BaseDatos, public babel: Babel, public sincronizacion: Sincronizacion, private platform: Platform, private funciones: FuncionesGlob, public DomSanitizer: DomSanitizer) {

//THIS GIVEME THE ERROR 'Object(…) is not a function
this.FileChooser.open().then(url => {
this.FilePath.resolveNativePath(url).then(pathAux => {


//THIS GIVEME THE ERROR TOO 'Object(…) is not a function
fetch(base64Data,
{
method: “GET”
}).then(res => res.blob()).then(blob => {
this.funciones.file.writeFile(this.funciones.file.externalApplicationStorageDirectory, nombre_fichero, blob, { replace: true }).then(res => {
this.fileOpener.open(
res.toInternalURL(),
tipo_mime
).then((res) => {
console.log(“metodo2 susscess”)
resolve(true);
}).catch(err => {
this.funciones.GrabarLog([‘open error’, err], false)
});
}).catch(err => {
this.funciones.GrabarLog([‘save error’, err], false)
});
}).catch(err => {
this.funciones.GrabarLog([‘error’, err], false)
})

The platform "35729" does not appear to have been added to this project

$
0
0

Hello,
You talking about downgraded the version of Gradle ? How to make that ?
Thanks!

Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

$
0
0

–prod is necessary, as it would minimize the app load time

Load modal component dynamically

$
0
0

I am trying to load a component dynamically into a modal box but I can’t seem to figure out how to do this correctly.

I managed to load the component dynamically by its name. I can then add it to the page:

    const factories = Array.from(this.componentFactoryResolver['_factories'].keys());
    const factoryClass = <Type<any>>factories.find((x: any) => x.name.toLowerCase() === "componentname");
    const componentFactory = this.componentFactoryResolver.resolveComponentFactory(factoryClass);
    let compRef = this.detailcontainer.createComponent(componentFactory);

But how can I add it to the component property when creating a modal dialog? compRef is of typeComponentRef<any> but component expects the type ComponentRef.

    return this.modalController.create({
      component: ???
    }).then((x) => x.present());

Thanks for helping!

Plugins native error: Object(...) is not a function

$
0
0

Tengo el mismo problema con FileChooser. La aplicación compila al agregar /ngx pero no funciona el método y no puedo elegir una imagen, que es lo que estoy intentando hacer. Alguien que se haya encontrado con este problema anteriormente y lo haya solucionado, ayuda por favor.

Not able to add id in ionic alert popup element

$
0
0

I have tried to add 'id ’ inside the ion-alert-controller, but not able to do. is there any way to add ID in the ionic alert controller? and also i want to add icon inside the alert popup, but did not find out any way. i’m new user of ionic frame-work. please help me

Ionic DevApp Feedback Mega-thread


In ionic v4 defult value not set in ion-select

$
0
0

any update about above condition

Ionic refresher too sensitive

Ionic 4 not showing data in HTML

$
0
0

l’m developing app.The code working fine in console with out any error , but no information in html. Here is the code : home.page.html

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-menu-button></ion-menu-button>
    </ion-buttons>
    <ion-title>
      Home
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
    <ion-grid>
      <ion-row>
        <ion-slides>
          <ion-slide *ngFor="let product of products">
           <ion-card no-padding>
              <img [src]= 'product.images[0].src' />
              <p>{{product.name}}</p>
              <p>{{product.title}}</p>
           </ion-card>
          </ion-slide>
        </ion-slides>
      </ion-row>
    </ion-grid>
</ion-content>

home.page.ts

import { Component } from '@angular/core';
import { NavController } from '@ionic/angular';
import * as WS from 'woocommerce-api';


@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {
  WooCommerce : any;
  products : any[];
  constructor(public navCtrl : NavController)
  {
    this.WooCommerce = WS({
      url:"http://*****.com",
      consumerKey: "ck_******",
      consumerSecret: "cs_*****",
      wpAPI: true,
      version: 'wc/v1'
    });
    this .WooCommerce.getAsync("products").then((data) =>{
      console.log(JSON.parse(data.body));
      this.products= JSON.parse(data.body).products;
    },(err) =>{
      console.log(err)
    })

}

Ionic Info:

ionic (Ionic CLI) : 4.10.0

System:

NodeJS : v11.8.0 npm : 6.5.0 OS : Windows 10

Ionic Documentation - Reorder

Ionic resources returns 410 (gone) error?

$
0
0

I just installed a brand new project, and I want to do

ionic cordova resources
Then, after typing my credentials, is this answer :

Request: POST https://api.ionic.io/login
Response: 410
Body:
{}

Has someone got this problem ?

Ionic cordova run with –prod stuck at splash for iOS and Android

$
0
0

Don’t - just use the CLI to create a Ionic 3 project.

Plugins native error: Object(...) is not a function


Plugins native error: Object(...) is not a function

$
0
0

Ionic 4 - must be a rtl/ltr bug? (MULTI LANGUAGE APP)

$
0
0

Have you reported this problem as a bug issue on GitHub with a full reproduction of what is going on so a maintainer can easily replicate it?

Cordova platform browser and PWA

$
0
0

Is it not clear to me how to use camera and media capture for PWA.
Should i use cordova platform “browser” ?
Or ionic native provide something different?
Or i’ve just to implement it in HTML5 myself?

Background Geolocation isn't a Observable

$
0
0

Thanks so much! Your repository saved my life!! In the Ionic v3 documentation background geolocation says that i need install the last version of the plugin and the version 4 of the background geolocation npm.

When I installed the same error occurred, looking your repository I saw that the versions of the plugin is 2.2.5 and the background geolocation npm is 3.12.1.

So, I installed this version of the plugin and version 3.14.0 of the background geolocation, its works fine now =) Thanks again!

Notifications are never shown

$
0
0

Hi!

I am not really experienced with Ionic, yet. So please bare with me.

I am trying to show a notification at a certain date and time. I have tried a lot, but it is never showing in the emulator. I found and edited this piece of code:

createnotification() {
let remindid = new Date().getUTCMilliseconds();
this.date = moment(“2019-01-31 12:20:00”).format(“YYYY-MM-DD HH:mm:ss”);

let notification = {
  id: remindid,
  title: this.title,
  text: this.description, 
  forceShow: 'true',
  coldstart: true,
  foreground: false,
  at: this.date
};

cordova.plugins.notification.local.schedule(notification);

let alert = this.alrtCtrl.create({
  title: 'Notifications set at ' + this.date,
  buttons: ['Ok']
});

alert.present();

}

I think it has something to do with the “at” property. I tried different variations of the date, used the “trigger”-property. Nothing seems to work.

What am I missing?

Viewing all 230447 articles
Browse latest View live


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