angular - Cannot read property 'initialized$' of undefined -
i'm using ngui/map on angular/node application. i'm receiving error mentioned above when try load map static page. flow follows. user opens side nav togglefunction , clicks faq link directs faq page via routerlink closes side nav togglefunction. if user opens sidenav , clicks logo return map, side nav not toggle , map not load , error thrown.
to sum up, if side nav open, , company link clicked, supposed close , route map, instead, stays open , throws initialize error , loads black screen side of side nav. if click again, map loads.
// here logic side nav
<div id="sidenavigation" class="sidenav" [ngstyle]="{width: sidenavactive ? '250px' : '0'}"> <a class="navbar-item" routerlink="/" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()" id="atlastext">company</a> <a class="navbar-item" routerlink="/what" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()" *ngif="!isloggedin()">faq</a> <a class="navbar-item" routerlink="/contact" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()" *ngif="!isloggedin()">contact</a> <a class="navbar-item" routerlink="auth/signin" *ngif="!isloggedin()" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()">sign in</a> <a class="navbar-item" routerlink="auth/signup" *ngif="!isloggedin()" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()">sign up</a> <a class="navbar-item" routerlink="/profile" *ngif="isloggedin()" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="showmobileprofilemenu()">profile</a> <a class="navbar-item" *ngif="isloggedin()" (click)="logout()" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()">sign out</a> <a class="navbar-item" routerlink="/contact" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()" *ngif="isloggedin()">contact</a> <a class="navbar-item" routerlink="/whatisatlas" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()" *ngif="isloggedin()">faq</a> </div>
// here map template
<ngui-map *ngif="!onmobileactionmenuactive() && !onmobileprofilemenuactive()" [maptypecontrol]="false" center="san diego, ca" id="map"> <directions-renderer [draggable]="false" (directions_changed)="directionschanged()" [directions-request]="direction" [suppressmarkers]="false"> </directions-renderer> </ngui-map>
// here initialize called in map.ts
ngoninit() { this.directionsrendererdirective['initialized$'].subscribe( directionsrenderer => { this.directionsrenderer = directionsrenderer; }); }
***** update able resolve issue don't understand resolution. removing *ngif statements on ngui-map error no longer raised. there 2 other menus can invoked, profile , action menu. true false toggles side nav. adding condition if false map true, invoke initalize of undefined error??
Comments
Post a Comment