@4geit/ngx-page-not-found-component

1.0.3 • Public • Published

@4geit/ngx-page-not-found-component npm version


Dummy page not found component.

Installation

  1. A recommended way to install @4geit/ngx-page-not-found-component is through npm package manager using the following command:
npm i @4geit/ngx-page-not-found-component --save

Or use yarn using the following command:

yarn add @4geit/ngx-page-not-found-component
  1. You need to import the NgxPageNotFoundComponent component within the module you want it to be. For instance app.module.ts as follows:
import { NgxPageNotFoundComponent } from '@4geit/ngx-page-not-found-component';

And you also need to add the NgxPageNotFoundComponent component with the @NgModule decorator as part of the declarations list.

@NgModule({
  // ...
  declarations: [
    // ...
    NgxPageNotFoundComponent,
    // ...
  ],
  // ...
})
export class AppModule { }
  1. You need to import the NgxPageNotFoundComponent component in the routing file you want to use it. For instance app-routing.module.ts as follows:
import { NgxPageNotFoundComponent } from '@4geit/ngx-page-not-found-component';

And you also need to add the NgxPageNotFoundComponent component within the list of routes as follows:

const routes: Routes = [
  // ...
  { path: '**', component: NgxPageNotFoundComponent }
  // ...
];

Therefore if an non-existent route is requested the app will display the NgxPageNotFoundComponent template.

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @4geit/ngx-page-not-found-component

    Weekly Downloads

    1

    Version

    1.0.3

    License

    MIT

    Last publish

    Collaborators

    • geraldinestarke
    • fabianstarke
    • canercandan