fix(animations): resolve error when using AnimationBuilder with platform-server (#18642)

Use an injected DOCUMENT instead of assuming the global 'document'
exists.

Fixes #18635.

PR Close #18642
This commit is contained in:
Vikram Subramanian
2017-08-10 18:08:49 -07:00
committed by Miško Hevery
parent 21c44672c4
commit 845c68fdb3
2 changed files with 7 additions and 4 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {animate, style, transition, trigger} from '@angular/animations';
import {AnimationBuilder, animate, style, transition, trigger} from '@angular/animations';
import {APP_BASE_HREF, PlatformLocation, isPlatformServer} from '@angular/common';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
@ -100,6 +100,8 @@ class SVGServerModule {
[transition('void => *', [style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
})
class MyAnimationApp {
constructor(private builder: AnimationBuilder) {}
text = 'Works!';
}