DI tricks
- a child can detect the presence of a parent (or any ancestor) with
@Optional
- ancestor components are accessible just like any dependency
- probably cleaner to detect the presence of an ancestor than touching the dom
- do NOT manipulate the ancestor from the child!
export class DogComponent {
constructor(@Optional() public alex: CanineComponent) {}
}