Class is using Angular features but is not decorated. Please add an explicit Angular decorator

前端 未结 3 2325
暖寄归人
暖寄归人 2020-12-20 11:36

I have some components like CricketComponent, FootballComponent, TennisComponent etc. All These Classes have some common properties :-

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-20 12:21

    With Angular 10, you can fix this issue by adding the decorator @Injectable() to your abstract base class like this:

    @Injectable()
    export abstract class BaseComponent {    
        @Input() teamName: string;
        @Input() teamSize: number;
        @Input() players: any;
    }
    

提交回复
热议问题