/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BROWSER_ANIMATIONS_PROVIDERS, BROWSER_NOOP_ANIMATIONS_PROVIDERS } from './providers'; import * as i0 from "@angular/core"; /** * Exports `BrowserModule` with additional [dependency-injection providers](guide/glossary#provider) * for use with animations. See [Animations](guide/animations). * @publicApi */ export class BrowserAnimationsModule { /** * Configures the module based on the specified object. * * @param config Object used to configure the behavior of the `BrowserAnimationsModule`. * @see {@link BrowserAnimationsModuleConfig} * * @usageNotes * When registering the `BrowserAnimationsModule`, you can use the `withConfig` * function as follows: * ``` * @NgModule({ * imports: [BrowserAnimationsModule.withConfig(config)] * }) * class MyNgModule {} * ``` */ static withConfig(config) { return { ngModule: BrowserAnimationsModule, providers: config.disableAnimations ? BROWSER_NOOP_ANIMATIONS_PROVIDERS : BROWSER_ANIMATIONS_PROVIDERS }; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BrowserAnimationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: BrowserAnimationsModule, exports: [BrowserModule] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BrowserAnimationsModule, providers: BROWSER_ANIMATIONS_PROVIDERS, imports: [BrowserModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BrowserAnimationsModule, decorators: [{ type: NgModule, args: [{ exports: [BrowserModule], providers: BROWSER_ANIMATIONS_PROVIDERS, }] }] }); /** * Returns the set of [dependency-injection providers](guide/glossary#provider) * to enable animations in an application. See [animations guide](guide/animations) * to learn more about animations in Angular. * * @usageNotes * * The function is useful when you want to enable animations in an application * bootstrapped using the `bootstrapApplication` function. In this scenario there * is no need to import the `BrowserAnimationsModule` NgModule at all, just add * providers returned by this function to the `providers` list as show below. * * ```typescript * bootstrapApplication(RootComponent, { * providers: [ * provideAnimations() * ] * }); * ``` * * @publicApi */ export function provideAnimations() { // Return a copy to prevent changes to the original array in case any in-place // alterations are performed to the `provideAnimations` call results in app code. return [...BROWSER_ANIMATIONS_PROVIDERS]; } /** * A null player that must be imported to allow disabling of animations. * @publicApi */ export class NoopAnimationsModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoopAnimationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NoopAnimationsModule, exports: [BrowserModule] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoopAnimationsModule, providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS, imports: [BrowserModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoopAnimationsModule, decorators: [{ type: NgModule, args: [{ exports: [BrowserModule], providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS, }] }] }); /** * Returns the set of [dependency-injection providers](guide/glossary#provider) * to disable animations in an application. See [animations guide](guide/animations) * to learn more about animations in Angular. * * @usageNotes * * The function is useful when you want to bootstrap an application using * the `bootstrapApplication` function, but you need to disable animations * (for example, when running tests). * * ```typescript * bootstrapApplication(RootComponent, { * providers: [ * provideNoopAnimations() * ] * }); * ``` * * @publicApi */ export function provideNoopAnimations() { // Return a copy to prevent changes to the original array in case any in-place // alterations are performed to the `provideNoopAnimations` call results in app code. return [...BROWSER_NOOP_ANIMATIONS_PROVIDERS]; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjo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