-1
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
Fateme Fazli
  • 11,582
  • 2
  • 31
  • 48
Shani
  • 11
  • 1
  • 7

1 Answers1

0

your app.module.ts should be:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

and in your main.ts add :

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';



if (environment.production) {
    enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule);
Fateme Fazli
  • 11,582
  • 2
  • 31
  • 48
  • import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.log(err)); @fatmee this also show error on AppModule – Shani Jun 27 '18 at 06:06
  • @fatmee now this error ERROR in Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options – Shani Jun 27 '18 at 06:10
  • are you sure your main.ts is in src folder? – Fateme Fazli Jun 27 '18 at 06:14
  • @fatmee yes 100% – Shani Jun 27 '18 at 06:17
  • ok lets try again, you change the app.module.ts to what i mentioned and change back the main.ts to what was before, now whats the result? – Fateme Fazli Jun 27 '18 at 06:22
  • @fatmee chek this i m importing this code in angular project https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/WebAPIService/Angular/Light/ – Shani Jun 27 '18 at 06:24