feat(animations): allow @.disabled property to work without an expression (#18713)

PR Close #18713
This commit is contained in:
Matias Niemelä
2017-08-15 12:51:29 -07:00
committed by Miško Hevery
parent 77ebd2b020
commit ac58914b97
3 changed files with 40 additions and 2 deletions

View File

@ -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);
});
});
});