In my html I have an img tag. In my ts code I wanted to get its width and height. The code looks like this:
home.html
<img id="myPic" src={{file}}>
home.ts
var pic = document.getElementById(‘myPic’);
console.log("CW ", pic.clientWidth);
console.log("CH ", pic.clientHeight);
It did not report the values properly (width was OK, height was not). For those having the same issue: It suddenly works when the plugin crosswalk is installed!
But installation had some side effects:
.toLocaleString() suddenly did not format the Date correctly. It used us-US instead of the currently installed locale. You need to explicitly specify the locale, e.g.
somedate.toLocaleString(‘de-DE’);
And another side effect:
The top statusbar of Android appeared. you can get rid of it using:
import { StatusBar } from ‘ionic-native’;
StatusBar.hide();
Last effect:
UI performance greatly enhances! Before crosswalk there was a huge lag between pressing a button and changing pages. BTW that was the reason I tried crosswalk in the first place.
HTH
(used environment: Ionic CLI 2.2.1, Ionic Framework 2.2.0, macOS Sierra, Node v6.9.2, Android 6.0.1)