rajaramtt / ng7-dynamic-breadcrumb

Angular 10 Dynamic Breadcrumbs
MIT License
42 stars 31 forks source link

Getting NullinjectorError while using. #30

Closed rishi1305 closed 3 years ago

rishi1305 commented 3 years ago

I followed the steps from https://www.npmjs.com/package/ng7-bootstrap-breadcrumb

after following till step 4 my app gives nullInjectorError

the error is like: Ng7BootstrapBreadcrumbService]: NullInjectorError: No provider for Ng7BootstrapBreadcrumbService! NullInjectorError: StaticInjectorError(AppModule)[Ng7BootstrapBreadcrumbComponent -> Ng7BootstrapBreadcrumbService]: StaticInjectorError(Platform: core)[Ng7BootstrapBreadcrumbComponent -> Ng7BootstrapBreadcrumbService]: NullInjectorError: No provider for Ng7BootstrapBreadcrumbService! at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (http://localhost:1337/vendor.js:60219:25) at resolveToken (http://localhost:1337/vendor.js:71412:24) at tryResolveToken (http://localhost:1337/vendor.js:71356:16) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (http://localhost:1337/vendor.js:71258:20) at resolveToken (http://localhost:1337/vendor.js:71412:24) at tryResolveToken (http://localhost:1337/vendor.js:71356:16) at StaticInjector.push../nodemodules/@angular/core/fesm5/core.js.StaticInjector.get (http://localhost:1337/vendor.js:71258:20) at resolveNgModuleDep (http://localhost:1337/vendor.js:79728:29) at NgModuleRef.push../nodemodules/@angular/core/fesm5/core.js.NgModuleRef.get (http://localhost:1337/vendor.js:80399:16) at resolveDep (http://localhost:1337/vendor.js:80770:45)

Is there anything else I need to implement?

rajaramtt commented 3 years ago

@rishi1305 I believe you missed the below step

Import the Ng7BootstrapBreadcrumbModule within your app:

import {Ng7BootstrapBreadcrumbModule} from "ng7-bootstrap-breadcrumb";

@NgModule({
  imports: [
    Ng7BootstrapBreadcrumbModule,
  ],
})
rishi1305 commented 3 years ago

@rishi1305 I believe you missed the below step

Import the Ng7BootstrapBreadcrumbModule within your app:

import {Ng7BootstrapBreadcrumbModule} from "ng7-bootstrap-breadcrumb";

@NgModule({
  imports: [
    Ng7BootstrapBreadcrumbModule,
  ],
})

I have already included this in app.