0

hello everyone I'm a beginner in Angular and I used angular material component but nothing appear in browser and when I inspect I found app-root empty any solutions?

this is app.module.ts

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

import {FlexLayoutModule} from '@angular/flex-layout';
import {MatToolbarModule} from '@angular/material/toolbar'; 
import { AppComponent } from './app.component';
import { MenuComponent } from './menu/menu.component';
import { MatListModule } from '@angular/material/list';
//import 'hammerjs';

@NgModule({
  declarations: [
    AppComponent,
    MenuComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FlexLayoutModule,
    MatToolbarModule,
    MatListModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

this is app.component.html:

<h1>Title 1</h1>
<app-menu></app-menu>
Eya Tayari
  • 31
  • 3
  • do you get any errors in the terminal or in the console? – Dario Piotrowicz Jan 16 '21 at 21:58
  • in the console I find only this warning : export 'ɵɵinject' was not found in '@angular/core' – Eya Tayari Jan 16 '21 at 22:02
  • maybe the issue is somewhere else then? could you share more code? is the code by any chance in a repo? – Dario Piotrowicz Jan 16 '21 at 22:03
  • I think you may have some dependency issues, if you want you can share your `package.json` file and I may try to help – Dario Piotrowicz Jan 16 '21 at 22:05
  • Does this answer your question? ["export 'ɵɵinject' was not found in '@angular/core'](https://stackoverflow.com/questions/56433781/export-%c9%b5%c9%b5inject-was-not-found-in-angular-core) – Dario Piotrowicz Jan 16 '21 at 22:17
  • @DarioPiotrowicz this is didn't help me – Eya Tayari Jan 16 '21 at 22:48
  • ` "@angular/cdk": "^6.4.7", "@angular/common": "^6.1.0", "@angular/compiler": "^6.1.0", "@angular/core": "^6.1.0", "@angular/flex-layout": "^6.0.0-beta.18", "@angular/forms": "^6.1.0", "@angular/material": "^6.4.7", "@angular/platform-browser": "^6.1.0", "@angular/platform-browser-dynamic": "^6.1.0", "@angular/router": "^6.1.0", "core-js": "^2.5.4", ` – Eya Tayari Jan 16 '21 at 22:49
  • ah ok :( , anyway copying your dependencies give me a different error, so I really am afraid that I would need more info (at the very least the whole package.json file) before I can try to help :'( – Dario Piotrowicz Jan 16 '21 at 22:55
  • okay this is the devdependencies part : "@angular-devkit/build-angular": "^0.8.9", "@angular/cli": "~6.2.1", "@angular/compiler-cli": "^6.1.0", "@angular/language-service": "^6.1.0", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "codelyzer": "~4.3.0", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~3.0.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "^0.2.2", – Eya Tayari Jan 16 '21 at 22:57

0 Answers0