I have a super class (component) and a few child classes (components) and I need to check PLATFORM_ID in each of them (something like below):
//Parent
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';
export class SliderComponent implements OnInit {
...
constructor(@Inject(PLATFORM_ID) private platformId: Object) {}
...
}
//Child
export class ProductsComponent extends SliderComponent implements OnInit {
...
constructor(private pls: ProductsService) {
super(); // <-- I don't want to pass smth. here because I'll need to import add. modules
}
...
}
Could I implement the inheritance without importing Inject, PLATFORM_ID, etc.?