@igniteui/angular-templates 18.0.1330-beta.2 → 18.0.1330-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ export const environment = {
2
+ production: true
3
+ };
@@ -0,0 +1,16 @@
1
+ // This file can be replaced during build by using the `fileReplacements` array.
2
+ // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3
+ // The list of file replacements can be found in `angular.json`.
4
+
5
+ export const environment = {
6
+ production: false
7
+ };
8
+
9
+ /*
10
+ * For easier debugging in development mode, you can import the following file
11
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
+ *
13
+ * This import should be commented out in production mode because it will have a negative impact
14
+ * on performance if an error is thrown.
15
+ */
16
+ // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
@@ -1,7 +1,13 @@
1
+ import { enableProdMode } from '@angular/core';
1
2
  import { bootstrapApplication } from '@angular/platform-browser';
2
3
 
3
4
  import { appConfig } from './app/app.config';
4
5
  import { AppComponent } from './app/app.component';
6
+ import { environment } from './environments/environment';
7
+
8
+ if (environment.production) {
9
+ enableProdMode();
10
+ }
5
11
 
6
12
  bootstrapApplication(AppComponent, appConfig)
7
13
  .catch((err) => console.error(err));
@@ -3,6 +3,7 @@ import { RouterModule, Routes } from '@angular/router';
3
3
 
4
4
  import { PageNotFoundComponent } from './error-routing/not-found/not-found.component';
5
5
  import { UncaughtErrorComponent } from './error-routing/error/uncaught-error.component';
6
+ import { ErrorRoutingModule } from './error-routing/error-routing.module';
6
7
 
7
8
  export const routes: Routes = [
8
9
  { path: 'error', component: UncaughtErrorComponent },
@@ -10,7 +11,7 @@ export const routes: Routes = [
10
11
  ];
11
12
 
12
13
  @NgModule({
13
- imports: [RouterModule.forRoot(routes, { bindToComponentInputs: true })],
14
- exports: [RouterModule]
14
+ imports: [RouterModule.forRoot(routes, { bindToComponentInputs: true }), ErrorRoutingModule],
15
+ exports: [RouterModule, ErrorRoutingModule]
15
16
  })
16
17
  export class AppRoutingModule { }
@@ -0,0 +1,23 @@
1
+ import { ErrorHandler, Injectable, Injector, NgZone } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+
4
+ @Injectable()
5
+ export class GlobalErrorHandlerService implements ErrorHandler {
6
+
7
+ constructor(private injector: Injector, private zone: NgZone) { }
8
+
9
+ handleError(error: any) {
10
+ // handle and/or log error, for example:
11
+ console.error(error);
12
+
13
+ // show error page
14
+ const router = this.injector.get(Router);
15
+ if (router) {
16
+ this.zone.run(() => {
17
+ router
18
+ .navigate(['error'])
19
+ .catch((err: any) => console.error(err));
20
+ });
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,21 @@
1
+ import { ErrorHandler, NgModule, Provider } from '@angular/core';
2
+ import { environment } from '../../environments/environment';
3
+ import { GlobalErrorHandlerService } from './error/global-error-handler.service';
4
+ import { UncaughtErrorComponent } from './error/uncaught-error.component';
5
+ import { PageNotFoundComponent } from './not-found/not-found.component';
6
+
7
+ const providers: Provider[] = [];
8
+
9
+ if (environment.production) {
10
+ // register prod error handler
11
+ providers.push({ provide: ErrorHandler, useClass: GlobalErrorHandlerService });
12
+ }
13
+
14
+ @NgModule({
15
+ declarations: [
16
+ PageNotFoundComponent,
17
+ UncaughtErrorComponent
18
+ ],
19
+ providers
20
+ })
21
+ export class ErrorRoutingModule { }
@@ -0,0 +1,3 @@
1
+ export const environment = {
2
+ production: true
3
+ };
@@ -0,0 +1,16 @@
1
+ // This file can be replaced during build by using the `fileReplacements` array.
2
+ // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3
+ // The list of file replacements can be found in `angular.json`.
4
+
5
+ export const environment = {
6
+ production: false
7
+ };
8
+
9
+ /*
10
+ * For easier debugging in development mode, you can import the following file
11
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
+ *
13
+ * This import should be commented out in production mode because it will have a negative impact
14
+ * on performance if an error is thrown.
15
+ */
16
+ // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
@@ -1,6 +1,12 @@
1
+ import { enableProdMode } from '@angular/core';
1
2
  import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2
3
 
3
4
  import { AppModule } from './app/app.module';
5
+ import { environment } from './environments/environment';
6
+
7
+ if (environment.production) {
8
+ enableProdMode();
9
+ }
4
10
 
5
11
  platformBrowserDynamic().bootstrapModule(AppModule)
6
12
  .catch(err => console.error(err));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igniteui/angular-templates",
3
- "version": "18.0.1330-beta.2",
3
+ "version": "18.0.1330-beta.3",
4
4
  "description": "Templates for Ignite UI for Angular projects and components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "author": "Infragistics",
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@igniteui/cli-core": "~13.3.0-beta.2",
15
+ "@igniteui/cli-core": "~13.3.0-beta.3",
16
16
  "typescript": "~5.4.3"
17
17
  }
18
18
  }