Implement State Control with localStorage
for Checkboxes (showRaw
and hiddenLabel
)
#10
Labels
enhancement
New feature or request
Implement checkboxes in the
ListTechsComponent
to manage the state ofshowRaw
andhiddenLabel
variables, with persistence inlocalStorage
. This will allow the checkbox selections to be retained across sessions following the implementation below.Tasks
Define Initial States in Component:
showRaw
andhiddenLabel
properties toListTechsComponent
.ngOnInit
, initialize these properties based on values stored inlocalStorage
.Add Template for Checkboxes:
list-techs.component.html
), using[(ngModel)]
for two-way binding.Save Changes to
localStorage
on Toggle:onCheckboxChange
method that updateslocalStorage
when a checkbox value changes.showRaw
andhiddenLabel
) by using type assertions or a helper method, following one of these approaches:onCheckboxChange
:The text was updated successfully, but these errors were encountered: