yagajs / leaflet-ng2

Angular.io integration of Leaflet
https://leaflet-ng2.yagajs.org
ISC License
66 stars 26 forks source link

TypeError on popup className setting #380

Closed anna-khokhlova closed 6 years ago

anna-khokhlova commented 6 years ago

Hi all,

I try to set CSS for popup: <yaga-popup [content]="label" [className]="'myCSS'"></yaga-popup>

css file contains:

.myCSS {
  background: red;
}

But it failes with an error:

ERROR TypeError: Cannot read property 'style' of undefined    
at PopupDirective._updateLayout (leaflet-src.js:9612)    
at PopupDirective.set [as className] (popup.directive.js:226)    
at updateProp (core.es5.js:11092)    
at checkAndUpdateDirectiveInline (core.es5.js:10805)    
at checkAndUpdateNodeInline (core.es5.js:12341)    
at checkAndUpdateNode (core.es5.js:12284)    
at debugCheckAndUpdateNode (core.es5.js:13141)    
at debugCheckDirectivesFn (core.es5.js:13082)    
at Object.eval [as updateDirectives] (AmpIndoorMapComponent.html:10)    
at Object.debugUpdateDirectives [as updateDirectives] (core.es5.js:13067)
atd-schubert commented 6 years ago

I cannot reproduce this issue. I had also problems, already solved in #377, but this does not throw any errors.

Can you @anna-khokhlova check this issue against the latest version of the develop branch?

anna-khokhlova commented 6 years ago

Hi atd-schubert, I will check it a bit later and will come back to you.

atd-schubert commented 6 years ago

I will close this issue. If you still have problems feel free to reopen this issue again...