Skip to content

Commit 0fa3e66

Browse files
authored
Merge pull request #1497 from IgniteUI/hhristov/add-missing-providers
fix(angular): add missing providers
2 parents b8f5b53 + a2bf7bf commit 0fa3e66

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

packages/igx-templates/igx-ts/projects/_base/files/src/app/app.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { ApplicationConfig, ErrorHandler, EnvironmentProviders, Provider, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
2-
import { provideRouter } from '@angular/router';
1+
import { ApplicationConfig, EnvironmentProviders, ErrorHandler, Provider, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
32
import { BrowserModule, HammerModule } from '@angular/platform-browser';
43
import { provideAnimations } from '@angular/platform-browser/animations';
4+
import { provideRouter } from '@angular/router';
55

6+
import { environment } from '../environments/environment';
67
import { routes } from './app.routes';
78
import { GlobalErrorHandlerService } from './error-routing/error/global-error-handler.service';
8-
import { environment } from '../environments/environment';
99

1010
// provide the HAMMER_GESTURE_CONFIG token
1111
// to override the default settings of the HammerModule
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import { ApplicationConfig, EnvironmentProviders, Provider, provideZoneChangeDetection } from '@angular/core';
1+
import { ApplicationConfig, EnvironmentProviders, Provider, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
2+
import { BrowserModule, HammerModule } from '@angular/platform-browser';
3+
import { provideAnimations } from '@angular/platform-browser/animations';
24
import { provideRouter } from '@angular/router';
35

46
import { routes } from './app.routes';
57

8+
// provide the HAMMER_GESTURE_CONFIG token
9+
// to override the default settings of the HammerModule
10+
// { provide: HAMMER_GESTURE_CONFIG, useClass: MyHammerConfig }
611
const providers: (EnvironmentProviders | Provider)[] = [
712
provideZoneChangeDetection({ eventCoalescing: true }),
8-
provideRouter(routes)
13+
provideRouter(routes),
14+
importProvidersFrom(BrowserModule, HammerModule),
15+
provideAnimations()
916
];
1017

1118
export const appConfig: ApplicationConfig = { providers };
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import { ApplicationConfig, EnvironmentProviders, Provider, provideZoneChangeDetection } from '@angular/core';
1+
import { ApplicationConfig, EnvironmentProviders, Provider, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
2+
import { BrowserModule, HammerModule } from '@angular/platform-browser';
3+
import { provideAnimations } from '@angular/platform-browser/animations';
24
import { provideRouter } from '@angular/router';
35

46
import { routes } from './app.routes';
57

8+
// provide the HAMMER_GESTURE_CONFIG token
9+
// to override the default settings of the HammerModule
10+
// { provide: HAMMER_GESTURE_CONFIG, useClass: MyHammerConfig }
611
const providers: (EnvironmentProviders | Provider)[] = [
712
provideZoneChangeDetection({ eventCoalescing: true }),
8-
provideRouter(routes)
13+
provideRouter(routes),
14+
importProvidersFrom(BrowserModule, HammerModule),
15+
provideAnimations()
916
];
1017

1118
export const appConfig: ApplicationConfig = { providers };

0 commit comments

Comments
 (0)