ng-lightning / ng-lightning

Native Angular components & directives for Lightning Design System

Home Page:http://ng-lightning.github.io/ng-lightning/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Icons are missing on datepicker component

danilopster opened this issue · comments

Icons are missing on datepicker because of somehow invalid path assets/icons/utility-sprite/svg/symbols.svg#...
If change manually path to /_slds/icons/utility-sprite/svg/symbols.svg#... it works
tried to use provider with NGL_ICON_CONFIG to change the path, but it doesn't help

Hello. I'm facing the same problem here.
Did a little debug on creating the svg component inside ngl-datepicker.
Looks like injection new value for NGL_ICON_CONFIG with '_slds/icons' doesn't work, because defaultConfig for some reason is null in the constructor.

Here, in the source code from svg.ts:

constructor(@Optional() @Inject(NGL_ICON_CONFIG) defaultConfig: NglIconConfig, el: ElementRef, renderer: Renderer2) {

    renderer.setAttribute(el.nativeElement, 'aria-hidden', 'true');

    const config = { ...new NglIconConfig(), ...defaultConfig };

    this.path = config.svgPath;

}

In compiled ng-lightning.js in browser, the defaultValue variable comes as null:

constructor(defaultConfig, el, renderer) {

    this.xPos = '0';

    renderer.setAttribute(el.nativeElement, 'aria-hidden', 'true');

    const config = Object.assign(Object.assign({}, new NglIconConfig()), defaultConfig);

    this.path = config.svgPath;

}