Pipes Map
Applies a pure transformation function to a value directly within the template, enabling functional-style composition without moving logic into the component class.
import { XMapPipe } from '@mixin-ui/cdk';
@Component({
template: `
{{ value | map: multiply: 100 }}
`
})
export class Usage {
readonly value = 1;
readonly multiply = (value: number, scale: number) => value * scale;
}
@for (year of years(); track year.getTime()) {
@let actual = year | map: isActual;
@let selected = year | map: isSelected: value();
@let disabled = year | map: isDisabled: min() : max();
<button
type="button"
[class.actual]="actual"
[class.selected]="selected"
[class.disabled]="disabled"
>
{{ year }}
</button>
}