You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/05/03 20:30:23 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #6753: Add Theming to TPv2

ocket8888 commented on code in PR #6753:
URL: https://github.com/apache/trafficcontrol/pull/6753#discussion_r864211210


##########
experimental/traffic-portal/src/app/app.component.ts:
##########
@@ -26,14 +28,15 @@ import { CurrentUserService } from "src/app/shared/currentUser/current-user.serv
 	styleUrls: ["./app.component.scss"],
 	templateUrl: "./app.component.html",
 })
-export class AppComponent implements OnInit {
+export class AppComponent implements OnInit, AfterViewInit {
+	@ViewChild("header") private readonly headerRef!: TpHeaderComponent;

Review Comment:
   I kinda hate `ViewChild` because it'll compile fine if the child doesn't actually exist.
   
   
   I know this is a major change to the PR, but what if instead we had a `ThemeService` or something that exposes a `BehaviorSubject` and the header just subscribes to it. Then you wouldn't need to register it either.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org