@ -30,8 +30,7 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
[
|
||||
state('collapsed, void', style({height: '0px', color: 'maroon', borderColor: 'maroon'})),
|
||||
state('expanded', style({height: '*', borderColor: 'green', color: 'green'})),
|
||||
transition(
|
||||
'collapsed <=> expanded', [animate(500, style({height: '250px'})), animate(500)])
|
||||
transition('collapsed <=> expanded', [animate(500, style({height: '250px'})), animate(500)])
|
||||
])],
|
||||
template: `
|
||||
<button (click)="expand()">Open</button>
|
||||
@ -44,10 +43,16 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
})
|
||||
export class MyExpandoCmp {
|
||||
// TODO(issue/24571): remove '!'.
|
||||
stateExpression !: string;
|
||||
constructor() { this.collapse(); }
|
||||
expand() { this.stateExpression = 'expanded'; }
|
||||
collapse() { this.stateExpression = 'collapsed'; }
|
||||
stateExpression!: string;
|
||||
constructor() {
|
||||
this.collapse();
|
||||
}
|
||||
expand() {
|
||||
this.stateExpression = 'expanded';
|
||||
}
|
||||
collapse() {
|
||||
this.stateExpression = 'collapsed';
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule(
|
||||
|
@ -6,7 +6,8 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {$, ExpectedConditions, browser, by, element} from 'protractor';
|
||||
import {$, browser, by, element, ExpectedConditions} from 'protractor';
|
||||
|
||||
import {verifyNoBrowserErrors} from '../../../../../test-utils';
|
||||
|
||||
function waitForElement(selector: string) {
|
||||
|
Reference in New Issue
Block a user