File
Metadata
| changeDetection |
ChangeDetectionStrategy.OnPush |
| selector |
cx-configurator-conflict-suggestion |
| templateUrl |
./configurator-conflict-suggestion.component.html |
Index
Properties
|
|
|
Methods
|
|
|
Inputs
|
|
|
HostBindings
|
|
|
|
suggestionNumber
|
Type : number
|
|
|
HostBindings
|
tabindex
|
Type : string
|
Default value : '0'
|
|
|
Methods
|
displayConflictSuggestion
|
displayConflictSuggestion(group: Configurator.Group)
|
|
|
Verifies whether the conflict suggestion should be displayed for the current group.
- 'True' if the conflict description should be displayed, otherwise 'false'.
|
|
groupType
|
Default value : Configurator.GroupType
|
|
|
|
suggestionNumber
|
Type : number
|
Decorators :
@Input()
|
|
|
|
tabindex
|
Type : string
|
Default value : '0'
|
Decorators :
@HostBinding('tabindex')
|
|
|
import {
ChangeDetectionStrategy,
Component,
HostBinding,
Input,
} from '@angular/core';
import { Configurator } from '../../core/model/configurator.model';
@Component({
selector: 'cx-configurator-conflict-suggestion',
templateUrl: './configurator-conflict-suggestion.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ConfiguratorConflictSuggestionComponent {
@Input() currentGroup: Configurator.Group;
@Input() attribute: Configurator.Attribute;
@Input() suggestionNumber: number;
groupType = Configurator.GroupType;
@HostBinding('tabindex') tabindex = '0';
constructor() {}
/**
* Verifies whether the conflict suggestion should be displayed for the current group.
*
* @param {Configurator.Group} group - Current group
* @return {boolean} - 'True' if the conflict description should be displayed, otherwise 'false'.
*/
displayConflictSuggestion(group: Configurator.Group): boolean {
return group.groupType === Configurator.GroupType.CONFLICT_GROUP &&
group.attributes
? group.attributes?.length > 1
: false;
}
}
<ng-container *ngIf="displayConflictSuggestion(currentGroup)">
<div class="cx-title">
{{
'configurator.conflict.suggestionTitle'
| cxTranslate: { number: suggestionNumber + 1 }
}}
</div>
{{
'configurator.conflict.suggestionText'
| cxTranslate: { attribute: attribute.label }
}}
</ng-container>
Legend
Html element with directive