0
votes

I am just beginning with Angular. When I try to run my angular app, it just shows a blank page and on inspecting it I find the app-root is empty. So I opened the app.component.ts file and find some error there

import { Component } from '@angular/core';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls:['./app.component.scss']
})
export class AppComponent {
  title = 'My Angular App';
}

Here at the component directive the error says

Argument of type '{ selector: string; templateUrl: string; styleUrls: string[]; }' is not assignable to parameter of type 'Component'.
Property 'true' is missing in type '{ selector: string; templateUrl: string; styleUrls: string[]; }'.

I didnt understand what I did wrong. Angular version 7

1
My guess is your cache isn't clean. Close your IDE, delete node_modules, npm cache clean, and npm install fresh is your best bet from here w/o more info. Other info needed would be the HTML where you have the <app-root></app-root> and the app-root html itself. Make sure you have all the imports in your app-module. Look at the app-root HTML and make sure all other components used in it are imported in it's module. - nircraft

1 Answers

0
votes

the problem is there

I think you don't use the correct import, declaretion in app.module.