Make the buttons change the color of the text
- Open the Exercise Problem stackblitz using the link below.
- In the
appColorsetter method set the CSS
colorof the host element using the
setStyle()method provided by the
Renderer2class instance is already injected into the class as a private instance variable using the
setStyle()method accepts three arguments: the element, the CSS style property name, and the value.
- The host element is the
elclass instance variable (hint: access this via
- When you click the "Red" button, the text color should be set to red, and when you click the "Blue" button, the text color should be set to blue.
- Feel free to study and play with this first exercise!