Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step symbol template #149

Merged
merged 2 commits into from Sep 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/components/wizard-navigation-bar.component.html
Expand Up @@ -13,11 +13,10 @@
<ng-container *ngIf="step.stepTitleTemplate" [ngTemplateOutlet]="step.stepTitleTemplate.templateRef"></ng-container>
<ng-container *ngIf="!step.stepTitleTemplate">{{step.stepTitle}}</ng-container>
</div>
<div *ngIf="step.stepSymbolTemplate" class="step-indicator">
<ng-container [ngTemplateOutlet]="step.stepSymbolTemplate.templateRef"></ng-container>
<div class="step-indicator" [ngStyle]="{ 'font-family': step.stepSymbolTemplate ? '' : step.navigationSymbol.fontFamily }">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be initial instead of ''?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'initial' will override user-defined styles, which, I believe, would be an unintended behavior.
Demo: https://stackblitz.com/edit/angular5-small-demos

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so basically, if an empty string is passed to a css attribute in [ngStyle] it is ignored/removed?

Copy link
Contributor Author

@earshinov earshinov Sep 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a feature of DOM API. When you assign an empty value to el.style.property, the CSS property is actually removed. Demo: https://jsfiddle.net/tcaz6kqu/

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I didn't know that.

<ng-container *ngIf="step.stepSymbolTemplate" [ngTemplateOutlet]="step.stepSymbolTemplate.templateRef"></ng-container>
<ng-container *ngIf="!step.stepSymbolTemplate">{{step.navigationSymbol.symbol}}</ng-container>
</div>
<div *ngIf="!step.stepSymbolTemplate" class="step-indicator"
[ngStyle]="{ 'font-family': step.navigationSymbol.fontFamily }">{{step.navigationSymbol.symbol}}</div>
</a>
</li>
</ul>