I've been working on a mini app using Ionic 2 and testing it in the browser with ionic serve. Inside my map.html
file, I have the following code snippet:
<ion-content >
<div id="myMap"></div>
</ion-content>
In my map.ts
file, I attempted to access this element like so:
this.platform.ready().then((readySource) => {
console.log('Platform ready from', readySource);
console.log(document.getElementById('myMap'));
//this.initializeMap();
});
But when I check the console, it shows:
Platform ready from dom
null
I'm scratching my head trying to figure out why it can't locate that element.
If anyone could offer some assistance, it would be greatly appreciated!