How to use currency and date filter for IOS in Ionic 2?
That's because it relies on the internalization API, which is not currently available in all browsers (compatibility table).
You can try to use a polyfill for Intl like this:
npm install --save intl
And then, add these imports to your app:
import 'intl';
import 'intl/locale-data/jsonp/en';
Ionic 2 - How to Import Intl polyfill
Normally the polyfill.ts is imported in the app module file that'll bootstrap your application normally this is the main.ts file, so importing the needed polyfill in the app module bootstrap file should do the trick.
Here is an example:
main.ts
import './polyfills.ts';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {enableProdMode} from '@angular/core';
import {environment} from './environments/environment';
import {AppModule} from './app/app.module';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
polyfill.ts
// All needed polyfills for example web animations
import 'web-animations-js/web-animations.min';
Date formatter is not working when using with ionic and angular v2
Install intl
package (or update package.json):
npm install intl
In polyfill.ts
or main.ts
import 'intl';
import 'intl/locale-data/jsonp/en.js';
Tested and working for Safari.
Ionic-Angular binding not removing DOM element, null number format causes binding to fail
We had a similar issue, which we resolved with the following workaround: We implemented a custom pipe which used JavaScript's native formatting:
if(value === null) {
return "";
}
Intl.NumberFormat().format(value);
The elegance of this is that we removed the burden of formatting from the view plus I think in your case it will remove the pipe chaining.
Related Topics
Tableview Reloaddata VS. Beginupdates & Endupdates
Can't Prevent 'Touchmove' from Scrolling Window on iOS
Nstimer - How to Delay in Swift
Get iOS Itunes App Store Id of an App Itself
How to Check If a Uialertcontroller Is Already Presenting
Swiftui: Unwanted Split View on iPad
How to Disable Caching from Nsurlsessiontask
How to Push Two View Controllers But Animate Transition Only for the Second One
Pod Error in Xcode "Id: Framework Not Found Pods"
Spacing Between Uitableviewcells
Hide Navigationbar When Scrolling Tableview in Collectionview
Memory Leak with Large Core Data Batch Insert in Swift
How to Create and Send the JSON Data to Server Using Swift Language
How to Get the Build Uuid in Runtime and the Image Base Address
Limit Uitextfield Input to Numbers in Swift