尝试使用此链接https://stack247.wordpress.com/2018/09/07/angular-all-possible-solutions-for-no-ngmodule/中的所有解决方案 当我尝试使用时,没有发生任何有用的事情 ng b --prod。 我不明白这个错误 装饰器不支持函数调用,但在'NgModule'中调用了'ɵmakeDecorator''NgModule'调用了'ɵmakeDecorator'
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/Core';
import{APP_BASE_HREF} from '@angular/common'
import {NgbModule,NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
import { AppComponent } from './app.component';
import{LoginComponent} from './login/login.component';
import{HomeComponent,NgbdModalsuccess,NgbdModaluploadfailed} from
'./home/Home.component'
import { Route, RouterModule } from '@angular/router';
import {CookieService} from 'ngx-cookie-service';
import { User } from './commen/user';
import { Image } from './commen/image';
import { HttpClientModule } from '@angular/common/http';
import{SocialLoginModule,AuthServiceConfig,GoogleLoginProvider}from
'angular5-social-login';
import { BrowserAnimationsModule } from '@angular/platform-
browser/animations';
export const ROUTES: Route[] = [
{ path: '', component: LoginComponent},
{ path: 'home', component: HomeComponent}
]
const config=new AuthServiceConfig([{
id:GoogleLoginProvider.PROVIDER_ID,
provider:new GoogleLoginProvider('810260133980-
m5ga3v7sglugi287eu2r0215p06e8gln.apps.googleusercontent.com')
}])
export function ProvideConfig(){
return config;
}
@NgModule({
declarations: [
AppComponent,
LoginComponent,
HomeComponent,
NgbdModalsuccess,
NgbdModaluploadfailed,
],
imports: [
BrowserModule,
RouterModule.forRoot(ROUTES),
SocialLoginModule,
HttpClientModule,
NgbModule,
],
providers: [
{provide: 'ROUTES', useValue: ROUTES},
{provide: APP_BASE_HREF, useValue : '/' },
{provide:AuthServiceConfig,useFactory:ProvideConfig},
CookieService,
User,
Image,
BrowserAnimationsModule,
NgbActiveModal,
],
entryComponents:[NgbdModaluploadfailed,NgbdModalsuccess],
exports: [RouterModule],
bootstrap: [AppComponent]
})
export class AppModule {
}
答案 0 :(得分:3)
我今天遇到了同样的问题。
在上面的代码中检查导入行3:
import { NgModule } from '@angular/Core';
系统模块名称区分大小写。将其更新到下面:
import { NgModule } from '@angular/core';
这可以解决问题。