No provider for NbAuthService!
See original GitHub issueI have copied /framework/auth directory to my project src/app directory.
and i imported auth module into my app module
`/**
- @license
- Copyright Akveo. All Rights Reserved.
- Licensed under the MIT License. See License.txt in the project root for license information. */ import { APP_BASE_HREF } from ‘@angular/common’; import { BrowserModule } from ‘@angular/platform-browser’; import { BrowserAnimationsModule } from ‘@angular/platform-browser/animations’; import { NgModule } from ‘@angular/core’; import { HttpModule } from ‘@angular/http’; import { CoreModule } from ‘./@core/core.module’;
import { AppComponent } from ‘./app.component’; import { AppRoutingModule } from ‘./app-routing.module’; import { ThemeModule } from ‘./@theme/theme.module’; import { NgbModule } from ‘@ng-bootstrap/ng-bootstrap’;
import { NbAuthModule } from “./auth/auth.module”;
@NgModule({ declarations: [AppComponent], imports: [ BrowserModule, BrowserAnimationsModule, HttpModule, AppRoutingModule,
NgbModule.forRoot(),
ThemeModule.forRoot(),
CoreModule.forRoot(),
NbAuthModule,
],
bootstrap: [AppComponent],
providers: [
{ provide: APP_BASE_HREF, useValue: ‘/’ },
],
})
export class AppModule {
}
and change my app-routing.module.ts to get auth components from copied directory
import {
NbAuthComponent,
NbLoginComponent,
NbLogoutComponent,
NbRegisterComponent,
NbRequestPasswordComponent,
NbResetPasswordComponent,
} from ‘./auth/components/index’;`
but when i try to access http://localhost:4200/#/auth/login i got error : ERROR Error: Uncaught (in promise): Error: No provider for NbAuthService! Error: No provider for NbAuthService!
can anyone help me? Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:24
Top GitHub Comments
any update on any documentation with examples of using an external auth provider such as auth0
based on the current version of nebular , you just need to import the library import {NbThemeModule, NbLayoutModule, NbSidebarModule, NbButtonModule, NbMenuModule, NbSidebarService} from ‘@nebular/theme’;
and then add the “NbSidebarService” to your provider :
providers: [NbSidebarService],
it should be working