These are chat archives for angular/angular-2-ionic-2

29th
Jan 2018
ragul
@ragulra
Jan 29 2018 12:40
Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined , i got this error
can any one know this
UncertaintyP
@UncertaintyP
Jan 29 2018 12:50
Your ElementRef has no referenced element I guess
not much to work with here :D
ragul
@ragulra
Jan 29 2018 13:08
@UncertaintyP , i have ElemenRef
UncertaintyP
@UncertaintyP
Jan 29 2018 13:15
So it doesn't find the reference in your template code
ragul
@ragulra
Jan 29 2018 13:15
yes
how to find ?
when console it , shows the TypeError: Cannot read property 'nativeElement' of undefined , i got this error i could not find
UncertaintyP
@UncertaintyP
Jan 29 2018 13:18
Your ElementRef property is null, this depends on how you resolve it but it is actually null
If you use ViewChild double check if the reference is spelled correctly
ragul
@ragulra
Jan 29 2018 13:19
@ViewChild('map') mapRef: ElementRef;
this is i did
<div style="height: 100%; width: 100%" #map id="map_canvas"></div>
i want to select the refrence in this div #map
UncertaintyP
@UncertaintyP
Jan 29 2018 13:23
Is this element hidden in some way when initialising the component?
ragul
@ragulra
Jan 29 2018 13:24
no it is not hidden
UncertaintyP
@UncertaintyP
Jan 29 2018 13:25
Then this should work
ragul
@ragulra
Jan 29 2018 13:25
it shows error
<div *ngIf="ismap">
this is map
<div style="height: 100%; width: 100%" #map id="map_canvas"></div>
</div>
i check the condtion ,
UncertaintyP
@UncertaintyP
Jan 29 2018 13:28
and what is ismap at initialisation?
ragul
@ragulra
Jan 29 2018 13:29
when initialising ismap is false when click the button it should true
i have two button one for menu another one for map , when click the menu it shows the menu and click the map it shows the map that is i maked now ismap always false , when click the map button it should change true
it is working for me when i remove the condtion
Tsilavina Razafinirina
@letsila
Jan 29 2018 19:23
hi guys, I am trying to implement an horizontal scrolling content in ionic2. Any idea on how could I implement it correctly?