I've been attempting to implement a dark theme for my Angular application, and although I've configured everything correctly, it doesn't seem to be working as expected.
Here is the code snippet:
constructor(private bookService: BookService, private categoryService: CategoryService, private formBuilder: FormBuilder, darkModeService: DarkModeService) {}
range = new FormGroup({
fromDate: new FormControl('', Validators.required),
toDate: new FormControl('', Validators.required)
});
darkMode$: Observable<boolean> = this.darkModeService.darkMode$;// encountered an issue at this point
ngOnInit(): void {
this.dateRangeForm = this.formBuilder.group({
fromDate: new FormControl('', Validators.required),
toDate: new FormControl('', Validators.required)
});
}
onToggle(): void {
this.darkModeService.toggle();//error occurs with this function
}