mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
681 B
681 B
/tsconfig.json
{
"compilerOptions": {
"strict": true
},
"files": ["inheritance.ts"]
}
/inheritance.ts
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: '[base]',
})
export class BaseDir {
constructor(public el: ElementRef) {}
}
@Directive({
selector: '[child]',
})
export class ChildDir extends BaseDir {
// Inherits constructor from BaseDir. Should delegate factory to BaseDir's factory.
}
@Directive({
selector: '[childWithCtor]',
})
export class ChildWithCtorDir extends BaseDir {
// Declares its own constructor. Should generate own ctor deps.
constructor(el: ElementRef) {
super(el);
}
}