import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
Asked
Active
Viewed 3,033 times
-1

Fateme Fazli
- 11,582
- 2
- 31
- 48

Shani
- 11
- 1
- 7
-
post your code here – Sajeetharan Jun 27 '18 at 05:41
-
@Sajeetharan which component code? i use devextreme in angular project so tell me please – Shani Jun 27 '18 at 05:45
-
your app.module.ts – Sajeetharan Jun 27 '18 at 05:46
-
@Sajeetharan import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule ], providers: [], bootstrap: [AppComponent] }) – Shani Jun 27 '18 at 05:47
-
post your code in the question and format it without adding a picture – Sajeetharan Jun 27 '18 at 05:48
-
Now? @Sajeetharan – Shani Jun 27 '18 at 05:51
-
do you export class AppModule { } ? – Fateme Fazli Jun 27 '18 at 05:56
-
export class AppModule { } platformBrowserDynamic().bootstrapModule(AppModule); @fatemefazli – Shani Jun 27 '18 at 05:58
1 Answers
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
-
-
-
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