2016-10-27 45 views
0

我現在嘗試了離子,發現了一些奇怪的行爲。aot-compilation breaks NumberPipe

當我使用ionic serve開始我的應用程序時,一切都完美無瑕。 一次,我已經捆綁使用ionic build browser它只要NumberPipe調用崩潰的應用程序:

<span>{{sizeVertical | number:'.2-2'}}</span> 

使得它與崩潰:

main.js:3646 TypeError: Cannot convert undefined or null to object 
    at new NumberFormat (native) 
    at Function.t.format (file:///.../build/main.js:9:9621) 
    at Te (file:///.../build/main.js:1:22885) 
    at t.transform (file:///.../build/main.js:9:12974) 
    at file:///.../www/build/main.js:1:9214 
    at e.detectChangesInternal (file:///.../build/main.js:33:31019) 
    (...) 

沒有管一切都很好。

我很確定這與我完全不熟悉的AoT編譯有關。

我該如何解決這個問題?任何提示將不勝感激!

+0

你確定你的管道是正確的嗎? number:'。2-2' – LeRoy

+0

是的,它是' - ' – j2L4e

回答