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

Missing locale data for the locale "USD"

$
0
0

@keeper3000 wrote:

I’m trying to use Currency Pipe but keep getting the error:

Missing locale data for the locale “USD”.

I have this in my app.module.ts:

  providers: [
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    {provide: LOCALE_ID, useValue: "en-US"},
  ]

and in my typescript file I have the following:

public currencyPipe: CurrencyPipe = new CurrencyPipe('USD');

I use it like this:

  toCurrency(value: any) {
    if (this.currencyPipe == null) {
      return '0';
    }
    return this.currencyPipe.transform(value, 'USD', true, '1.0-0');
  }

Anyone have any suggestions? I’ve tried en-US and $ instead of USD, nothing has worked. In the ionic 2 beta releases this worked ok.

Posts: 1

Participants: 1

Read full topic


How to upload input data to firebase

Button to remove/hide grid layout

$
0
0

@wongjunyuan wrote:

home/home.html

<button ion-button id=“isGrid” class=“isGrid”(click)=“changemode(‘isGrid’)”>Grid
<ion-item-sliding *ngFor=“let grid of grids”>

{{grid.title}}


<button (click)=“deleteGrid(grid)” danger>



home/home.scss

.grid-full ion-row {
height: 1%;
padding: 0%;
flex-wrap: wrap;
}

      .grid-full ion-col {
        flex: 0 0 0%;
        max-width: 0%;
        text-align:center;
        padding: 131px 3px;
      }

      .cell-1 {
        background-color: #C5DCFC;
      }


      .grid-full1 ion-col {
        flex: 0 0 0%;
        max-width: 0%;
        text-align:center;
        padding: 5px 10000px;
      }
       .cell-2 {
        background-color: #C5DCFC;
      }

      .grid-full2 ion-col {
        flex: 10 10 10%;
        max-width: 0%;
        text-align:right;
        padding: 0px 10000px;
        background-color: #C5DCFC;
      }

      .grid-full2 ion-col {
        flex: 10 10 10%;
        max-width: 0%;
        text-align:center;
        padding: 3px 1000%;
      }

      .grid-full2 ion-row {
        height:10%;
        padding: 2.5%;
        flex-wrap: wrap-reverse;
        background-color: transparentize($color: #C5DCFC, $amount: 1)
      }
      .grid-full2 ion-row{
        padding: 2.5%

      }

Posts: 1

Participants: 1

Read full topic

Designing model structure

$
0
0

@JeffMinsungKim wrote:

Hi, guys. I wonder should I create an individual directory for each page component inside a model directory?
Assume that I have users and files page components.
Not quite sure how to design the model structure. Please share your brilliant ideas with us. Thank you.

   ├── app
   ├── models
       |── users
       │   |── Users.ts
       │    └──interfaces
       |   |   └── IUsers.ts
       |── files
           |── Files.ts
           └──interfaces
               └── IFiles.ts

Posts: 1

Participants: 1

Read full topic

Can not Build an APK for Android

$
0
0

@Barbarosa wrote:

Hey guys, Please I need help. I am trying to build an APK for android, and it keeps giving me the following error. I tried everything out there online, and never worked. Please help.

BUILD FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:transformClassesWithJarMergingForDebug’.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/cordova/PermissionHelper.class

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Total time: 1 mins 51.939 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:transformClassesWithJarMergingForDebug’.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/cordova/PermissionHelper.class

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

[ERROR] An error occurred while running cordova build android (exit code 1).

Posts: 1

Participants: 1

Read full topic

Sqlite in Ionic 3

$
0
0

@pendora7 wrote:

Hey, I am using SQlite in Ionic 3. I want to get an Id from table 1 and pass that onto table 2 in order to get some data. Alert is showing that Initially for loop of table 1 initiates and then after getting all values it passes that data onto next table. I am getting answer but it prints for example: Question #01 and all answers than it prints Question #02 than all answers.


Thank You.

Posts: 1

Participants: 1

Read full topic

Files are Not Generated in any templates whenever we are create a new IONIC Project

$
0
0

@MustafaLokhandwala wrote:

I had created a new Project with blank template and also with every template, i found that inside home folder there is nothing. I mean to say that there is no files are generated (.ts, .html, .scss)
Why so that?
Please Help me…
Thanks.

Posts: 1

Participants: 1

Read full topic

Responsive card

$
0
0

@EnzoDLP wrote:

Hello,

I am currently doing my application is I encounter a problem with the responsive … Indeed I would like my card to take the whole page as on the screen of the iphone 4 but I can not, on iphone 6 for example there is a huge space and all laptops are different … how to make it take all the page all the time?

Thank you…

Posts: 2

Participants: 1

Read full topic


item.toLowerCase is not a function

$
0
0

@flycoders_sourav wrote:

This is my code:
items:any[] = [];

 ngOnInit() {
    this.setItems();
  }

  setItems() {
    this.items;
  }

  filterItems(ev: any) {
    this.setItems();
    let val = ev.target.value;

      if (val && val.trim() !== '') {
      this.items = this.items.filter(function(item) {
        return item.toLowerCase().includes(val.toLowerCase());
      });
    }
  }

i’m array push from here:

ionViewDidLoad() {
   var headers = new Headers();
    headers.append('Content-Type', 'application/x-www-form-urlencoded');
    let options = new RequestOptions({ headers: headers });

     this.http.get(myurl+"/leadlistingusers");

      .subscribe((res:Response)=>{
      let dataTemp = res.json(); //dataTemp is the json object you showed me
      this.mydata = dataTemp.viewleadusers; //contains a [] object with all yours user
       for(let i = 0; i < this.mydata.length; i++){

            let a = this.mydata[i].userName;
            let b= this.mydata[i].userID;
            alert(b);
            alert(a);
            this.items.push({
               "userID": b,
               "userName":a
            });

       }
  })

 };

How can i fix that.

Posts: 1

Participants: 1

Read full topic

TTS in Arabic

$
0
0

@moazzam5 wrote:

Hi All,

Can anyone help me with the code, how I can implement text to speech in Arabic in my ionic 2 application?
Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Get Postal Code with GoogleMaps native

Search functional issue

$
0
0

@flycoders_sourav wrote:

when i clear the search box it still showin the only search value.my previous list item is not showing

i want to do like that Please click here.
here is my full code how can i do that please suggest me.

items:any[] = [];
mydata: any;

  constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http) {


  //start auto load
 let self = this;
  setInterval(function () {
    self.items;
  }, 300);
  //end
  }


 ngOnInit() {
    this.setItems();
  }

  setItems() {
    this.items = this.items;
  }

  filterItems(ev: any) {
    this.setItems();
    let val = ev.target.value;

      if (val && val.trim() !== '') {
      this.items = this.items.filter(function(item) {
        return item.userName.toLowerCase().includes(val.toLowerCase());
      });
    }
  }
  ionViewDidLoad() {
   var headers = new Headers();
    headers.append('Content-Type', 'application/x-www-form-urlencoded');
    let options = new RequestOptions({ headers: headers });

     this.http.get(url+"/leadlistingusers")

      .subscribe((res:Response)=>{
      let dataTemp = res.json(); //dataTemp is the json object you showed me
      this.mydata = dataTemp.viewleadusers; //contains a [] object with all yours user
      for(let i = 0; i < this.mydata.length; i++){

            let a = this.mydata[i].userName;
            let b= this.mydata[i].userID;
            alert(b);
            alert(a);
            this.items.push({
               "userID": b,
               "userName":a
            })
       }
  })

 };

Posts: 1

Participants: 1

Read full topic

Http request: "Response with status: 0 for URL: null"

$
0
0

@WouterDoornbos wrote:

Hello!

When i try to make an http request with the following code:

  getValuations(token: string, limit: number, page: number, orderBy: string, filter: string) {
        var headers = new Headers();
        headers.append('Accept', 'application/json');
        headers.append('Authorization', 'Bearer ' + token);
        let options = new RequestOptions({ headers: headers });
        return this.http.get(this.api_base + '/request/v1/valuation/?limit=' + limit + '&page=' + page + "&orderBy=" + orderBy + "&filter=" + filter, options).map(res => res.json());
    }

I get as response:

Response with status: 0 for URL: null

This happens only when i use the command "ionic cordova run Android --livereload --consolelogs"
When i build the app without livereload and consolelogs it works just fine. This happens on both Android and iOS.

I hope someone can help me with this issue.

Posts: 1

Participants: 1

Read full topic

Ionic 2 Time Picker - Set picker time and not value

$
0
0

@Dagert1 wrote:

// Controller
this._display = 'HH:mm';
this._picker = 'HH:mm';
this._control = /* Basic angular form control with value */

// View
<ion-datetime [displayFormat]="_display" [pickerFormat]="_picker" [formControl]="_control"></ion-datetime>

If the _control value is null, I would like the picker to display a time that is 3 hours in the future without setting the _control value.

Is there a way to accomplish this?

I have tried to follow the steps of https://forum.ionicframework.com/t/ionic-ion-datetime-how-to-set-default-picker-value-without-changing-the-model/74156/4, but it does not work:

// Controller
setDefaultDate() {
    this._tmpDefaultDate = moment().add(3, 'hours').format('YYYY-MMM-DD HH:mm:ss');
  }

  cancel() {
    if(!this._control.value) {
      this._tmpDefaultDate = '';
    }
  }

// View
<ion-datetime [displayFormat]="_display" [pickerFormat]="_picker" [formControl]="_control" [(ngModel)]="_tmpDefaultDate" (ionCancel)="cancel()" (tap)="setDefaultDate()"></ion-datetime>

Posts: 1

Participants: 1

Read full topic

Ionic 2 App takes 16 seconds to start

$
0
0

@touqeeraslam786 wrote:

My ionic app takes 16 seconds to start , after splash screen of 3 seconds it atleast 13 seconds to start can you please help ??
tried --prod several times during build

ionic cordova build android --prod
and also tried
cordova build android --prod
but still facing this issue please help

Posts: 1

Participants: 1

Read full topic


Ionic 3 - pop back 2 pages

$
0
0

@jjo422 wrote:

What is the best way to navigate backwards two pages or N pages. I have used the remove method and then pop, but I would prefer to transition directly to the Nth page back and not momentarily see the views iterate backwards.

Posts: 1

Participants: 1

Read full topic

How to import and use Wialon.js SDK

Navigation problem (through folders) for import

$
0
0

@devsm wrote:

Sorry if I’m a noob, but I have this structure in my project:

src ==> pages ==> HeroesList;
src==> model ==> Hero;

How can I import my hero in the heroesList?

I tried like this:

import { Hero } from './model/hero/hero';
OR
import { Hero } from '../model/hero/hero';
OR
import { Hero } from '../hero/hero';
OR
import { Hero } from '../hero';
OR
import { Hero } from '../model/hero';

Posts: 1

Participants: 1

Read full topic

Ionic logging

$
0
0

@mdline wrote:

Hello,

I am using the ionic-logging-service for making logs.
I build my app for ios with “ionic cordova build ios –prod”, but I don’t get any log prints. My phone is connected with PC via USB and I expect that I get logs in the XCode builder. Any idea?

Posts: 1

Participants: 1

Read full topic

Camera: Plugin_not_installed

$
0
0

@wthijmen wrote:

Hi all,

Whem I’m running my app trough ionic View app the camera works.
But when I’m running it from a debug package build from ionic pro I’m getting an error.

My code

startCamera(selectedSourceType:number)
    {

        let iQuality = parseInt(this.localstorage.getStorage('quality'));
        let bSaveSet = (this.localstorage.getStorage('save-photos') == 'true');

        const options: CameraOptions = {
            sourceType: selectedSourceType,
            quality: iQuality,
            destinationType: this.camera.DestinationType.DATA_URL,
            correctOrientation: true,
            encodingType: this.camera.EncodingType.JPEG,
            mediaType: this.camera.MediaType.PICTURE,
            targetWidth: 1024,
            targetHeight: 1024,
            saveToPhotoAlbum: bSaveSet
        }

        if(this.platform.is('android'))
        {
            this.platform.ready().then(() =>
            {
                this.camera.getPicture(options).then((imageData) => {

                    // Object picture
                    this.oObject['picture'] = 'data:image/jpg;base64,' + imageData;
                    if(this.oObject['picture'] !== '')
                    {
                        this.forwardToElements();
                    }


                    // Replace button
                    this.replaceBtn();

                }, (err) => {

                    // Handle error
                    alert(err);

                });
            });
        }
    }

Im landing in this section:

}, (err) => {

     // Handle error
     alert(err);

});

The content on the alert is:
plugin_not_installed

But yes, in my package.json I’ve the plugin installed.

"@ionic-native/camera": "^3.12.1",

Im wondering why it’s working in Ionic view app and not working in the debug .APK

Hope that some one can help me!

Posts: 1

Participants: 1

Read full topic

Viewing all 49526 articles
Browse latest View live


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