Now it's possible.
animations: [
trigger('flyInOut', [
state('for', style({
left: '{{left_indent}}', // use interpolation
}), {params: {left_indent: 0}}), // default parameters values required
transition('* => for', [
animate(2000, keyframes([
style({ opacity: 1, transform: 'translateX(0)', offset: 0 }),
style({ opacity: 1, transform: 'translateX(-300px)', offset: 0.5 }),
]))
]),
])
]
UPDATE (according to SplitterAlex answer):
in template (for Angular < 4.4.6):
<div [@flyInOut]="{value: triggerValue, left_indent: left_indent}"></div>
for Angular >= 4.4.6 template should be
<div [@flyInOut]="{value: triggerValue, params: {left_indent: left_indent}}"></div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…