I have a logo component that essentially writes out an image element. The template looks like this:
<picture class="logo"> <source srcset="{{srcsetMobile}}" media="(max-width: 767px)"> <source srcset="{{srcsetDesktop}}" media="(min-width: 768px)"> <img class="logo" title="{{title}}" alt="{{alt}}" src="{{fallbackSrc}}" </picture>
In angular2 this gives
<picture _ngcontent-lox-3="" class="logo"> <source _ngcontent-lox-3="" media="(max-width: 767px)" ng-reflect-srcset="/assets/img/Logo-mobile.png" srcset="/assets/img/Logo-mobile.png"></source> <source _ngcontent-lox-3="" media="(min-width: 768px)" ng-reflect-srcset="/assets/img/Logo.png" srcset="/assets/img/Logo.png"></source> <img _ngcontent-lox-3="" class="logo" ng-reflect-title="title" title="title" ng-reflect-alt="alt text" alt="alt text" ng-reflect-src="/assets/img/Logo-mobile.png" src="/assets/img/Logo-mobile.png"> </picture>
This works fine in Chrome, but only a mobile image is uploaded in Firefox. The tag loads fine outside of Angular. When I use the web inspector and remove the angular attributes, everything works fine, so I think this is a browser error, but I thought I would post it here to find out if others have problems or if someone has a workaround.
source share