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

Ionic angular-calendar 'date-fns' format

$
0
0

@ki32 wrote:

Hi there,

I’m trying add actives to firebase, pull them and display in my angular calendar. However, it complains on date format. I’m trying to format it such as new Date(my_date). However, it’s not pushing this format to firebase this way…

As you can see required format is start: Sat Apr 07 2018 00:00:00 GMT+0100 (GMT Summer Time)

I have: "2018-04-07T18:37:00Z"

My method for pushing at this moment:

 addEvent(event: CalendarEvent) {
    this.afDatabse.list(`/events/`).push({
      start: event.start,
      end: event.end,
      title: event.title,
      color: 'test',
      allDay: event.allDay
    })

CalendarEvent interface:

import { EventColor } from "./EventColor";
import { EventAction } from "./EventAction";
export interface CalendarEvent {
  start: any;
  end?: any;
  title: string;
  color: EventColor;
  actions?: EventAction[];
  allDay?: boolean; 
}

My html:

    <ion-item>
      <ion-input type="text" placeholder="Title" [(ngModel)]="events.title"></ion-input>
    </ion-item>

    <ion-item>
      <ion-label>From:</ion-label>
      <ion-datetime displayFormat="HH:mm DD/MM/YYYY " pickerFormat="MMM D:HH:mm" [(ngModel)]="events.start"></ion-datetime>
    </ion-item>

    <ion-item>
      <ion-label>To:</ion-label>
      <ion-datetime displayFormat="HH:mm DD/MM/YYYY " pickerFormat="MMM D:HH:mm" [(ngModel)]="events.end"> </ion-datetime>
    </ion-item>

    <ion-item>
      <ion-label>All Day?</ion-label>
      <ion-checkbox [(ngModel)]="events.allDay"></ion-checkbox>
    </ion-item>

Posts: 5

Participants: 3

Read full topic


Refactoring from an old java app and release to play store

$
0
0

@BenjaminR wrote:

Hi,

I have an “old” app written in java available on the play store. I just finished writing a “new” app with ionic (v3).
I want to release my “new” app on the play store, but don’t want to create a totally new app on the store , I just want to update the old app. What steps should I follow, where I have to define the name of the package, how to sign the apk if I have a sign key…
Thanks

Posts: 4

Participants: 2

Read full topic

Ionic 3 ngrx - injecting a provider into reducer

$
0
0

@BrentAshWilliams wrote:

Hello,

I am using ngrx for state management. In one of my reducers I want to access functionality in a provider I created. I am not sure how to inject/access the provider functionality from the reducer (if it was a component I could inject it via the constructor).

Any ideas?

thanks,

Brent

Posts: 2

Participants: 2

Read full topic

Is it possible to run Ionic 3 with AngularJS?

$
0
0

@razaviv wrote:

AngularJS is simplier and easy to use over Angular 2+.

Is there a way to use AngularJS in Ionic 3 and save the performances that Ionic team made, but with AngularJS instead of Angular 2+?

Posts: 1

Participants: 1

Read full topic

Can't bind to 'x' since it isn't a known property of 'button'

$
0
0

@Maxtor3569 wrote:

Hello everyone.

I’m been struggling for days to dynamically change an attribute of a button with angular binding.
Here is my element
<button [mark]=“mark” (click)=“gotoUser(user?._lat, user?._lon)”>

And when I build I got this error. Can’t bind to ‘mark’ since it isn’t a known property of ‘button’.
This syntax should be perfectly valid in angular and I don’t understand why it’s not working. I try with @Input() as well.

The error disappears if I use [attr.mark] instead, but I cannot change the data after in my component. ( this syntax should be used for conditional attr which it’s not my case I only want to change the value)

Posts: 2

Participants: 2

Read full topic

Force app update

$
0
0

@beck24 wrote:

What’s the best way to ensure people aren’t using outdated versions of an app? I’ve seen some apps like banking apps and even Pokemon Go that force an update at times. I couldn’t find any plugins for that in Ionic Native - does anyone know of anything offhand?

Posts: 3

Participants: 2

Read full topic

Chaining Promises in Ionic 3

$
0
0

@mhtchong wrote:

Hi everyone,

I have a bit of trouble getting my head around this issue. So in my component.ts I want to check everything in the database once the device is ready. I have managed to do a part of it but I have a condition in which if

  1. hasSavings() == true and hasPin() == true, my root page becomes the PinCodePage.
  2. hasSavings() == true and hasPin() == false, my root page becomes the SavingsPage
  3. hasSavings() == false, automatically the root page becomes the TutorialPage

However, I cannot seem to figure out how to do this.

This is my code:

this.dp.createDatabase().then(data => {
        if(data) {
          return this.dp.hasSavings();
        }else {
          return false;
        }
      }).then(data => {
        if(data) {
          this.rootPage = SavingsPage;
        }else {
          this.rootPage = TutorialPage;
        }

        return this.dp.hasCategory()

      }).then(data => {
        if(data) {
          console.log("Tables already populated.");
          return false;
        }else {
          return this.dp.populateTables();
        }

      }).then(data => {
        console.log("Tables successfully populated!");

      }, err => {

          console.log("Nope");

        })
       
      });

Kinda confused on how to use promises. If I also made some mistakes in implementing them please do enlighten me.

Thank you!

Posts: 1

Participants: 1

Read full topic

First Implementations

$
0
0

@Neonic1 wrote:

Hey everyone,
I have an idea for a new project (it’s an app - obviously; don’t get offended now) I want the app for Android only right now. I want it to start up and allow the user to setup a fingerprint scanner (if applicable); then that’d be the end of the app. All they have to do is close it and it’ll run in the background when something specific (like network) changes and then send them a Local Push Notification like “Hey, so [it] changed!”.

I’ve thought maybe I’d implement OneSignal, Background Mode, and Android Fingerprint Auth.

I need suggestions, ideas on what’ll be the most efficient/easiest way to instantly deploy the app that way whenever the network (it’s a network management app) detects a change it’ll alert the user with a Local Push Notification and update the change under their account on the app.

Which Storage would be best for a simple local only app?

What would be the best approach in achieving this?

Thanks.

Posts: 1

Participants: 1

Read full topic


When I use ion-select directive as a shared component in template of the main component, it will not be shown on the main component's template. It'll show as blank on the screen

$
0
0

@JeongJun wrote:

When I use ion-select directive as a shared component in template of the main component, it will not be shown on the main component’s template. It’ll show as blank on the screen. But other directives like ion-button will be shown well normally on the screen. I think it a bug in Ionic 3. Am I right?

[home.html]

<ion-list>
    <ion-item>
      <ion-label>
        Gender
      </ion-label>
      <select-test></select-test>
   </ion-item>
 </ion-list>

[home.module.ts]

import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ComponentsModule } from '../../components/components.module';
import { HomePage } from './home';

@NgModule({
  declarations: [
    HomePage
  ],
  imports: [
    IonicPageModule.forChild(HomePage),
    ComponentsModule
  ],
})
export class HomePageModule {}

[select-test.html]

<ion-select>
  <ion-option value="f">Female</ion-option>
  <ion-option value="m">Male</ion-option>
</ion-select>

[component.module.ts]

import { NgModule } from '@angular/core';
import { IonicModule } from 'ionic-angular';
import { SelectTestComponent } from './select-test/select-test';
@NgModule({
	declarations: [
    SelectTestComponent
  ],
	imports: [
    IonicModule
  ],
	exports: [
    SelectTestComponent
  ]
})
export class ComponentsModule {}

[dependencies]
@angular/animations”: “5.2.9”,
@angular/common”: “5.2.9”,
@angular/compiler”: “5.2.9”,
@angular/compiler-cli”: “5.2.9”,
@angular/core”: “5.2.9”,
@angular/forms”: “5.2.9”,
@angular/http”: “5.2.9”,
@angular/platform-browser”: “5.2.9”,
@angular/platform-browser-dynamic”: “5.2.9”,
@ionic-native/core”: “4.6.0”,
“ionic-angular”: “3.9.2”,
@ionic/app-scripts”: “3.1.8”,

Posts: 6

Participants: 2

Read full topic

Getting wrong file name for pdf or other type files except image file using input in Ionic?

$
0
0

@setu1421 wrote:

I am using html input for selecting a file from file manager in my Ionic3/Angular application for Android/iOS. I am using below code for this:

// in .html file

<input #fileUpload type="file" name="myfile"(change)="onFileChoose($event)"/>

// in .ts file

  onFileChoose($event): void {
    this.fileChooser.getFileInfo($event).then((result) => {
      this.fileName = result.fileName;
      this.fileData = this.sanitizeFileData(result.fileData);
      this.fileSize = result.fileSize;
      this.fileType = result.fileType;
    }, (error) => {
      this.helperProvider.createAlert('Alert', 'File is corrupted.');
    });
  }

 getFileInfo(event: Event): Promise<any> {

    let target = event && event.target;
    let files: Array<File> = target && target['files'];

    console.log(files[0].type);
    console.log(files[0].name);

    return new Promise((resolve, reject) => {
      if (files && files.length) {
        files = Array.from(files);
        let fileName = files[0].name;
        let fileSize = files[0].size;
        let fileType = files[0].type;
        let fileReader = new FileReader();

        fileReader.onload = () => resolve({
          fileData: fileReader.result,
          fileName: fileName,
          fileSize: fileSize,
          fileType: fileType
        });

        fileReader.onerror = error => reject(error);

        fileReader.onabort = error => reject(error);

        fileReader.readAsDataURL(files[0])
      }
    });
  }

I could perfectly select an image file from file manager in android and get the type, size and name of the file. But, when i select a pdf, suppose from downloads folder of file manager, i am getting the file type as empty and the file name as a different name than the original pdf file name. But, the size of the pdf file is correct.

Suppose, my pdf file name is “abc.pdf” but when i select the pdf file, i got the name as 5002 a random number and the type of the file as empty. I also saw that i am getting this behavior in all the files except the image files.

NOTE:

This is perfectly working in browser. But it is showing this weird behavior in android device.

Should i need any permission for reading pdf files using file manager in android?

Can anyone help me on this?

Posts: 2

Participants: 2

Read full topic

I am getting error

Using Vue as an Angular alternative for Ionic: Routing part 1

Visualising my mapped object with Charts.js

$
0
0

@perenyitamas wrote:

I have a map object: As you can see it is nesting by year-month-day.

I would like to create a bar chart where you can see those numbers for “Keszeg”, “Ponty”…etc based on the year-month-day. My code is ready but i can’t get it working. At this part i am getting undefinied error for the yearVal.entries.

This is the sulyhavonta.entries:
K%C3%A9pkiv%C3%A1g%C3%A1s

for (let [yearKey, yearVal] of sulyhavonta.entries()) { for (let [monthKey, monthVal] of yearVal.entries())

 let labels = [];
    let datasets = [];
    let fishData = {};

    this.firebasedb.list("/fogasok/").subscribe(_data => {

            // this.osszesfogasadatok = _data.filter(item => item.publikus == true);
            // let fogasSzam=this.osszesfogasadatok.length;
            let sulySum = _data.reduce((sum, item) => sum + parseInt(item.suly), 0);
            let sulySumMap = _data.map((item, index) => {
              var n = new Date(item.datum);
              return {

                ev: n.getFullYear(),
                honap: n.getMonth() + 1,
                nap: n.getDate(),
                suly: item.suly,
                halfaj: item.halfaj,
                eteto: item.etetoanyag1,
                csali: item.hasznaltcsali,
                helyszin: item.helyszin
              }

            });

    var sulySumByDate = d3.nest()
    .key(function (d) {
      return d.ev;
    })
    .key(function (d) {
      return d.honap;
    })
    .key(function (d) {
      return d.nap;
    })
    .key(function (d) {
      return d.halfaj;
    })
    .rollup(function (values) {
      return d3.sum(values, function (d) {
        return parseInt(d.suly);
      });
    })
    .map(sulySumMap)
    var sulyhavonta=sulySumByDate;
    console.log("sulyhavonta",sulyhavonta)
    for (let [yearKey, yearVal] of sulyhavonta.entries()) {
      for (let [monthKey, monthVal] of yearVal.entries()) {
        for (let [dayKey, dayVal] of monthVal.entires()) {
          labels.push(yearKey + '.' + monthKey + '.' + dayKey);
          for (let [fish, fishVal] of dayVal.entires()) {
            if (fishData[fish] === undefined) {
              fishData[fish] = [];
            }
            fishData[fish].push(fishVal);
            console.log("fishdata",fishData);
          }
        }
      }
    }
    var colors = [
      ["#ce8d00", "#ffae00"],
      ["#007bce", "#84ceff"]
    ];
    var i = 0;
    for (let key in fishData) {
      datasets.push({
        label: key,
        data: fishData[key],
        backgroundColor: colors[i % 2][0],
        hoverBackgroundColor: colors[i % 2][1],
        hoverBorderWidth: 0
      });
      i++;
    }
    console.log("dataset",datasets)
  });

    var bar_ctx = document.getElementById('bar-chart');
    var bar_chart = new Chart(bar_ctx, {
      type: 'bar',
      data: {
        labels: labels,
        datasets: datasets
      },
      options: {
        animation: {
          duration: 10,
        },
        scales: {
          xAxes: [{
            stacked: true,
            gridLines: {
              display: false
            },
          }],
          yAxes: [{
            stacked: true
          }],
        }, // scales
        legend: {
          display: true
        }
      } // options
    });

Just a quick note, instead of the reading from firebase and d3 nesting, it is working with static data, but i would like to use the code above to directly read from my database.

var sulyhavonta = new Map([ [2018, new Map([ [1,new Map([[15, new Map([[‘keszeg’,3],[‘ponty’,5]])], [29, new Map([[‘keszeg’,1],[‘ponty’,1]])]])], [5,new Map([[24, new Map([[‘keszeg’,9],[‘ponty’,7]])]])] ] )] ]);

Posts: 1

Participants: 1

Read full topic

Ionic Native Spinner Dialog Not working

$
0
0

@ManivannanDurairaj wrote:

console.warn: Native: tried calling SpinnerDialog.show, but the SpinnerDialog plugin is not installed.
console.warn: Install the SpinnerDialog plugin: 'ionic cordova plugin add cordova-plugin-native-spinner'

Installed ionic native spinner dialog but it shows above the error.

cli packages: (C:\Users\DuraiMalar\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.0.2
    Node              : v9.11.1
    npm               : 5.3.0
    OS                : Windows 10

Help me guys,
Thanks,
Mani

Posts: 1

Participants: 1

Read full topic

Facing this problem while building app for production release doCodegen

$
0
0

@princehr wrote:

16:35:14] copy started …
[16:35:14] ngc started …
TypeError: Cannot read property ‘codeGen’ of undefined
at Object.doCodegen (F:\geopresence by a_l\version\geopresence_v2\node_modules@ionic\app-scripts\dist\aot\codegen.js:6:50)
at F:\geopresence by a_l\version\geopresence_v2\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:42:30
[16:35:19] copy finished in 5.26 s

Posts: 1

Participants: 1

Read full topic


Don't work cordova-plugin-fcm with cordova-plugin-background-geolocation

$
0
0

@xkelxmc wrote:

Theme

i have problem with use cordova fcm and cordova background geolocation on my ionic v3 app
I have app, this running correctly with fcm, but i add background geolocation, and then have drop and errors…

before add cordova-plugin-background-geolocation my app build and runing corectly

Your Environment

  • Ionic version: latest (4.0.0-rc.2)
  • Plugin version: v2.3.5 cordova-plugin-background-geolocation
  • Platform: Android
  • OS version: 5.0.2
  • Device manufacturer and model: redmi note 2
  • Cordova version (cordova -v): 8.0.0
  • Cordova platform version (cordova platform ls):
    Installed platforms:
    android 7.0.0
    Available platforms:
    browser ~5.0.1
    ios ~4.5.4
    osx ~4.0.1
    windows ~5.0.0
    www ^3.12.0
  • Plugin configuration options:
  • Link to your project:

Context

My app have Building failed - google service error, i do magic witch versions and build.gradle, and i have win, my app building successful with comment (FCMPlugin.gradle)
// apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

and change version from 11+ to 12.0.1 in (project.properies)
cordova.system.library.2=com.google.android.gms:play-services-location:12.0.1
BUT my app has ceased runs on my device, hi drop after start…

Who can help me?))
p.s. sry for my bad english

Steps to Reproduce

  1. create ionic app
  2. add https://github.com/fechanique/cordova-plugin-fcm
  3. add cordova-plugin-background-geolocation
  4. have nice day with errors, and build failed

Posts: 1

Participants: 1

Read full topic

Load old version when i deployed apk output

$
0
0

@Artarad wrote:

Hi ,
I have an application that developed by ionic.
when I build apk and deploy it on my device, in first run it work ok but when run it again, it load very old version.
how can i fix this problem.
I have this problem in ios version too.
thanx

Posts: 2

Participants: 2

Read full topic

How return artist name by artist id when use wp api

Ionic 3 not show title on navController.push pages , but show in appMenuItems page. Why?

$
0
0

@anespa wrote:

Friends,
I have a home page with some items as shown
Home%20page
and there is an appmenu items links which show some page links.
Appitems

When I click with Home page items , it will not show relevant title , but with appmenu it shows correctly. But after back from appmenu items still it shows that page title even we click the link the home page and go there .

How this issue can fix ?

Please advise

Thanks
Anes

Posts: 4

Participants: 2

Read full topic

Ionic buid need internet connection?

$
0
0

@Jamesionic wrote:

I built my application with ‘ionic cordova build android --prod’ , it is working when I have internet connection. but when there is no internet connection , it stuck somewhere and can not build , also without any error message.

Am I able to build without internet connection?

thanks.

Posts: 1

Participants: 1

Read full topic

Viewing all 71247 articles
Browse latest View live


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