Issue description
I am trying to use agm-snazzy-info-window without marker but getting error on rendering of this window
here is code:
<div *ngIf="selectedMarker" >
<agm-snazzy-info-window
[latitude]="selectedMarker.latitude"
[longitude]="selectedMarker.longitude"
[isOpen]="true">
{{selectedMarker.id}}
</agm-snazzy-info-window>
</div>
_What steps should we try in your demo to see the problem?_
add agm-snazzy-info-window ui component, set input parameter [isOpen]="true"
Current behavior
error in console:
core.es5.js:1020 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'createEmbeddedView' of undefined
TypeError: Cannot read property 'createEmbeddedView' of undefined
at ViewContainerRef_.webpackJsonp.../../../core/@angular/core.es5.js.ViewContainerRef_.createEmbeddedView (core.es5.js:10056)
at AgmSnazzyInfoWindow.webpackJsonp.../../../../@agm/snazzy-info-window/directives/snazzy-info-window.js.AgmSnazzyInfoWindow._createViewContent (snazzy-info-window.js:154)
at snazzy-info-window.js:140
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:392)
at Object.onInvoke (core.es5.js:3890)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (zone.js:142)
at zone.js:844
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.es5.js:3881)
at ViewContainerRef_.webpackJsonp.../../../core/@angular/core.es5.js.ViewContainerRef_.createEmbeddedView (core.es5.js:10056)
at AgmSnazzyInfoWindow.webpackJsonp.../../../../@agm/snazzy-info-window/directives/snazzy-info-window.js.AgmSnazzyInfoWindow._createViewContent (snazzy-info-window.js:154)
at snazzy-info-window.js:140
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:392)
at Object.onInvoke (core.es5.js:3890)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (zone.js:142)
at zone.js:844
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.es5.js:3881)
at resolvePromise (zone.js:795)
at zone.js:847
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.es5.js:3881)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)
at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask (zone.js:192)
at drainMicroTaskQueue (zone.js:602)
at <anonymous>
angular2 & angular-google-maps version
"agm/core": "1.0.0-beta.1",
"agm/snazzy-info-window": "1.0.0-beta.1",
"snazzy-info-window": "1.1.0",
Other information
Interesting think that when I remove parameter [isOpen] from template the error disappear.
Same here...
Had the same problem. After checking the docs here
https://angular-maps.com/guides/snazzy-info-window/custom-info-windows-with-snazzy-info-window/ I've noticed that you need to have <ng-template>
wrapping the content of <agm-snazzy-info-window>
in order to work.
And it worked :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Had the same problem. After checking the docs here
https://angular-maps.com/guides/snazzy-info-window/custom-info-windows-with-snazzy-info-window/ I've noticed that you need to have
<ng-template>
wrapping the content of<agm-snazzy-info-window>
in order to work.And it worked :)