New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Angular2 Currency Pipe not working on iOS #5710
Comments
Hey @flavordaaave How did you manage to put it to work? i'm using the numeric pipe and i'm importing the polyfill in the entries of the webpack config file and yet my app brokes in IOS, i can't seem to understand how to include the polyfill correctly. |
I'm hesitant to add this to the core of Ionic, as it seems like a pretty large library that many apps may not need. However, having some good docs on how to get add this to webpack yourselves would be pretty useful. Does anyone have a good example on how to include this? |
I just did with webpack, in entries after installing the npm package just put: module.exports = {
entry: [
path.normalize('es6-shim/es6-shim.min'),
'reflect-metadata',
path.normalize('zone.js/dist/zone-microtask'),
'intl/index.js',
'intl/locale-data/jsonp/en.js',
path.resolve('app/app')
], However this could not be the best way of using it. |
Thanks @Luchillo fixed my problem too! #5601 |
I agree that this probably should not be added to the core framework, but this should definitely be included in the docs, maybe in the faq section on the docs? @adamdbradley thoughts? |
@Luchillo Thanks for solution! But didn't worked for me though.
But still I could see that Safari claims
Please help! |
Well i'm not sure, i just use the Have you tried with just the |
@Luchillo I'm using the same configuration as you do but for me it is working without any errors:
|
@flavordaaave So you made it work? great, it seems you have 2 type of currencies, since @fedorinoGore has also 2 currencies and his app breaks i think his app is miss-configured or installed, can both of you put the output of ionic info
Your system information:
Cordova CLI: 6.0.0
Gulp version: CLI version 1.2.1
Gulp local: Local version 3.9.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.6.0
Xcode version: Xcode 7.2.1 Build version 7C1002 |
|
@fedorinoGore You asked what you may have missed. You probably didn't miss this, but you must quit in the command line (q) and run ionic serve again, too apply webpack changes....... I doubt you missed this, but mentioning anyway |
@Luchillo Cordova CLI: 6.0.0 |
@alexbainbridge Nope, that is not it. I restarted server just after modifying webpack config. |
@fedorinoGore What about your |
Hello! Thanks for opening an issue with us! Since it has been a little while since there was any activity on this issue i will be closing it, but feel free to respond back if your still having the issue! Thanks again! |
Ups... I was too slow. |
Has someone figured out a nice way to include the |
My solution is to add the needed scripts to src like this:
|
@flavordaaave So you moved to browserify? I'm still using Webpack, and it works as a charm, i can't help you with browserify. |
I tried to do this by just referencing 'intl/index.js' and 'intl/locale-data/jsonp/en.js' in my index.html and including the files in the build folder but this didn't seem to make it work. Could do with some help getting this into my project! Using the latest ionic-beta.10 |
@mbrookson first what build workflow do you use? i made it work in webpack but if you want to use browserify ask @flavordaaave. Second, for me i just import it in my Third, make sure it is being loaded, in browser look at the network tab, in ios (which is the real reason to use this polyfill) use safari inspector to inspect the app and then look at the network tab. |
@Luchillo I am using the default browserify build. The polyfills.ts file doesn't exist anywhere in my project. @flavordaaave Where did you add the scripts using browserify? Did you just modify the build file in the |
|
@flavordaaave Cool, thanks. So is that the root level |
@mbrookson yes, I just updaten those 2 tasks in my root gulpfile. |
@flavordaaave Does browserify have any notion of order or priority? i would put the dependencies up in the array, does browserify not care about that? |
@Luchillo to be honest I don't know. It was working for me that way so I didn't change anything 😉 |
@kchat001 |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Type: feat
Ionic Version: 2.x
Platform: ios 9 webview
Angular2 is using the ECMAScript Internationalization API for e.g. its currency pipe.
Unfortunately all current Safari browser don't support that API, so
{{product.price' | currency: 'USD':true}}
won't work on iOS.I got this working for now by using this polyfill:
https://github.com/andyearnshaw/Intl.js
I'm aware that this is an angular2 issue but I'd suggest to include this polyfill until this is fixed on angular side to not confuse ionic2 users.
The text was updated successfully, but these errors were encountered: