feat(animations): allow @.disabled property to work without an expression (#18713)
PR Close #18713
This commit is contained in:

committed by
Miško Hevery

parent
77ebd2b020
commit
ac58914b97
@ -2599,6 +2599,43 @@ export function main() {
|
||||
fixture.detectChanges();
|
||||
expect(getLog().length).toEqual(1);
|
||||
});
|
||||
|
||||
it('should treat the property as true when the expression is missing', () => {
|
||||
@Component({
|
||||
selector: 'parent-cmp',
|
||||
animations: [
|
||||
trigger(
|
||||
'myAnimation',
|
||||
[
|
||||
transition(
|
||||
'* => go',
|
||||
[
|
||||
style({opacity: 0}),
|
||||
animate(500, style({opacity: 1})),
|
||||
]),
|
||||
]),
|
||||
],
|
||||
template: `
|
||||
<div @.disabled>
|
||||
<div [@myAnimation]="exp"></div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
class Cmp {
|
||||
exp = '';
|
||||
}
|
||||
|
||||
TestBed.configureTestingModule({declarations: [Cmp]});
|
||||
|
||||
const fixture = TestBed.createComponent(Cmp);
|
||||
const cmp = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
resetLog();
|
||||
|
||||
cmp.exp = 'go';
|
||||
fixture.detectChanges();
|
||||
expect(getLog().length).toEqual(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user