Use an Observable in combination with the async pipe instead. It handles subscriptions automatically for you. Check out the documentation: ngClass.
確定! 回上一頁