什麼是PageSlotComponent

解決方案
理論依據
In Angular you can inject the closest parent component of a given type, by passing it as a constructor dependency.
You might want to add @Optional() decorator if you plan to use your component outside the content slot (i.e. as a static component). It will help avoid crashing app in the runtime, but will just resolve PageSlotComponent instance safely to null.
看一個運作時的例子:
Angular裡可以很容易的通過依賴注入,在一個Component的構造函數裡,注入其祖先引用作為依賴。這樣,Component裡就能通路其祖先執行個體上的資料。