I am new to angular5 and I am trying to use the authorization in NGX-ADMIN by following the doc of link but although, it does not mark me errors, when executing the ngx-admin, it remains hanging and in the console the following error comes out: Uncaught Error: Unexpected value 'HttpResponse' imported by the module 'CoreModule'. Please add to @NgModule annotation. I put my sources:
core.module.ts
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NbAuthModule, NbEmailPassAuthProvider } from '@nebular/auth';
import { throwIfAlreadyLoaded } from './module-import-guard';
import { DataModule } from './data/data.module';
import { AnalyticsService } from './utils/analytics.service';
import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
import { getDeepFromObject } from '../helpers/helpers';
const NB_CORE_PROVIDERS = [
...DataModule.forRoot().providers,
...NbAuthModule.forRoot({
providers: {
email: {
service: NbEmailPassAuthProvider,
config: {
baseEndpoint: 'http://localhost/hcg/webservice/public',
login: {
alwaysFail: false,
rememberMe: true,
endpoint: '/login',
method: 'post',
redirect: {
success: '/',
failure: null,
},
defaultErrors: ['Login/Email combination is not correct, please try again.'],
defaultMessages: ['You have been successfully logged in.'],
},
/*register: {
alwaysFail: false,
rememberMe: true,
endpoint: '/api/auth/register',
method: 'post',
redirect: {
success: '/',
failure: null,
},
defaultErrors: ['Something went wrong, please try again.'],
defaultMessages: ['You have been successfully registered.'],
},
logout: {
alwaysFail: false,
endpoint: '/api/auth/logout',
method: 'delete',
redirect: {
success: '/',
failure: null,
},
defaultErrors: ['Something went wrong, please try again.'],
defaultMessages: ['You have been successfully logged out.'],
},
requestPass: {
endpoint: '/api/auth/request-pass',
method: 'post',
redirect: {
success: '/',
failure: null,
},
defaultErrors: ['Something went wrong, please try again.'],
defaultMessages: ['Reset password instructions have been sent to your email.'],
},
resetPass: {
endpoint: '/api/auth/reset-pass',
method: 'put',
redirect: {
success: '/',
failure: null,
},
resetPasswordTokenKey: 'reset_password_token',
defaultErrors: ['Something went wrong, please try again.'],
defaultMessages: ['Your password has been successfully changed.'],
},*/
token: {
key: 'data.token',
getter: (module: string, res: HttpResponse<Object>) => getDeepFromObject(res.body,
this.getConfigValue('token.key')),
},
errors: {
key: 'data.errors',
getter: (module: string, res: HttpErrorResponse) => getDeepFromObject(res.error,
this.getConfigValue('errors.key'),
this.getConfigValue('${module}.defaultErrors')),
},
messages: {
key: 'data.messages',
getter: (module: string, res: HttpResponse<Object>) => getDeepFromObject(res.body,
this.getConfigValue('messages.key'),
this.getConfigValue('${module}.defaultMessages')),
},
},
},
},
}).providers,
AnalyticsService,
];
@NgModule({
imports: [
CommonModule,
HttpResponse,
HttpErrorResponse
],
exports: [
NbAuthModule,
],
declarations: [],
})
export class CoreModule {
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
throwIfAlreadyLoaded(parentModule, 'CoreModule');
}
static forRoot(): ModuleWithProviders {
return <ModuleWithProviders>{
ngModule: CoreModule,
providers: [
...NB_CORE_PROVIDERS,
],
};
}
}
and my app.module.ts
/**
* @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';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpModule,
AppRoutingModule,
NgbModule.forRoot(),
ThemeModule.forRoot(),
CoreModule.forRoot(),
],
bootstrap: [AppComponent],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' },
],
})
export class AppModule {
}
the rest of the files are "immaculate", I mean as they come with the ngx-admin. Can you give me a hand to see what is missing? Thank you all for your minutes