This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(material): remove template expression as Angular 12 breaks it again
- Loading branch information
1 parent
3150fd2
commit 1c4e9f4
Showing
7 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { HostBinding, Inject } from '@angular/core'; | ||
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; | ||
import { ActionButton } from '@ng-action-outlet/core'; | ||
import { ActionAnchor } from '@ng-action-outlet/core'; | ||
import { ACTION_ICON_TYPE_TOKEN, ICON_TYPE } from './action-icon-type-token'; | ||
|
||
@Component({ | ||
selector: 'action-mat-content', | ||
template: ` | ||
<mat-icon *ngIf="action?.icon$ | async; let icon" [svgIcon]="_isSvgIcon() ? icon : null"> | ||
{{ icon }} | ||
</mat-icon> | ||
<span [innerHTML]="action?.title$ | async"></span> | ||
`, | ||
styles: [ | ||
` | ||
.action-mat-content { | ||
display: contents; | ||
} | ||
`, | ||
], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None, | ||
}) | ||
export class ActionMatContentComponent { | ||
@HostBinding('class.action-mat-content') readonly _classname = true; | ||
@Input() action?: ActionButton | ActionAnchor; | ||
|
||
constructor( | ||
@Inject(ACTION_ICON_TYPE_TOKEN) | ||
readonly _iconType: ICON_TYPE, | ||
) {} | ||
|
||
_isSvgIcon() { | ||
return this._iconType === ICON_TYPE.Svg; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters