1

I have following code snippet :

home.html :

 <ion-item>
       <ion-label>Date:</ion-label>
       <ion-label class="alignme">{{todayDate | date: "MM/dd/yy" }}</ion-label>
      </ion-item>

home.ts:

import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';


@Component({
  templateUrl: 'build/pages/home/home.html'
})

export class HomePage {

this.todayDate = new Date();

}

While loading application on device it is showing blank screen . When i remove pipe from todayDate , it's showing current date value.

mobigaurav
  • 194
  • 1
  • 2
  • 14
  • Possible duplicate of [Ionic 2, Using Angular 2 Pipe breaks on iOSβ€”"Can't find variable: Intl"](http://stackoverflow.com/questions/35017800/ionic-2-using-angular-2-pipe-breaks-on-ios-cant-find-variable-intl) – John Siu Aug 31 '16 at 21:34
  • john, thanks for your update , but it did not work by using shared link. – mobigaurav Sep 01 '16 at 13:18
  • Check my answer, let me know if it solve your issue. – John Siu Sep 01 '16 at 16:00

1 Answers1

1

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.

John Siu
  • 5,056
  • 2
  • 26
  • 47