1
- import { Component , HostBinding , NgModule , OnInit } from '@angular/core' ;
1
+ import { Component , HostBinding , Inject , NgModule , OnInit , Optional } from '@angular/core' ;
2
+ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
2
3
import { SvgViewerModule } from '../../shared/svg-viewer/svg-viewer' ;
3
4
import { MatButtonModule } from '@angular/material/button' ;
4
5
import { FooterModule } from '../../shared/footer/footer' ;
@@ -18,13 +19,19 @@ const TOP_COMPONENTS = ['datepicker', 'input', 'slide-toggle', 'slider', 'button
18
19
@Component ( {
19
20
selector : 'app-homepage' ,
20
21
templateUrl : './homepage.html' ,
21
- styleUrls : [ './homepage.scss' ]
22
+ styleUrls : [ './homepage.scss' ] ,
22
23
} )
23
24
export class Homepage implements OnInit {
24
25
@HostBinding ( 'class.main-content' ) readonly mainContentClass = true ;
26
+ @HostBinding ( 'class.animations-disabled' ) readonly animationsDisabled : boolean ;
27
+
25
28
isNextVersion = location . hostname . startsWith ( 'next.material.angular.io' ) ;
26
29
27
- constructor ( public _componentPageTitle : ComponentPageTitle , public guideItems : GuideItems ) {
30
+ constructor (
31
+ public _componentPageTitle : ComponentPageTitle ,
32
+ public guideItems : GuideItems ,
33
+ @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) animationsModule ?: string ) {
34
+ this . animationsDisabled = animationsModule === 'NoopAnimations' ;
28
35
}
29
36
30
37
ngOnInit ( ) : void {
0 commit comments