Pipes on iOS devices do not work,
however on android devices or in the browser pipes for currency or number format work just fine.
Here the versions I am using:
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.10.1
Xcode version: Xcode 7.3.1 Build version 7D1014
"dependencies": {
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"@angular/router": "^2.0.0-rc.1",
"angular2-moment": "^0.8.0",
"es6-shim": "^0.35.0",
"ionic-angular": "2.0.0-beta.7",
"ionic-native": "^1.1.0",
"ionicons": "3.0.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12"
I recently converted one of my old ionic1 directives to a pipe to use with ionic2 and it’s working fine in iOS, Browser, Android. It’s only a simple pipe though that takes a time value in ms and returns a formatted time value in MM:SS format.
Here’s the code if that helps at all.
But if you try something simple like
{{someNumber | currency : 'eur' : true :'.2-2' }}
does that work for you on iOS as well?
{{someNumber | currency : ['eur', true, '.2-2'] }}
With your code I only get a Invalid currency code: EUR,true,.2-2
pff… if you don’t know how use array, then I can’t help you. Sorry.
Bit in the current angular2 documentation it says:
We add parameters to a pipe by following the pipe name with a colon ( : ) and then the parameter value (e.g., currency:‘EUR’). If our pipe accepts multiple parameters, we separate the values with colons (e.g. slice:1:5)
I don’t currently have a pipe passing parameters, I am working on one shortly for filtering lists, will update once I have played with it.
(Ionic 2)
This simple pipe isn’t working in IOS for me:
date:“dd MMM HH:mm”
{{order.timestamp | date:"dd MMM HH:mm"}} works in browsers but not IOS.
{{order.timestamp}} works in browsers and IOS.
EDIT
Found a fix. Basically, add this script tag to index.html
Running unit tests in non-Chrome browsers raised some doubts about this API which is currently used in the Date and Currency...
comp: common
comp: i18n
effort2: medium (days)
flag: breaking change
freq2: medium
severity3: broken
state: Needs Design
type: bug
1 Like
Fixed the issue for me. What a pain! Thanks