Trouble with change background color in popover

I am trying to recreate what is currently being implemented in the popover that’s in the documentation here – All I want is for the background to change colors; however, I am getting an error in my console when the color is selected - TypeError: Cannot read property ‘style’ of undefined. I have also posted this question on stackoverflow here – Unsure of how to resolve this issue. Thanks

This is giving me a case of deja vu.

I still can not solve the problem, I think the code that Ionic provides in its documentation is somewhat obsolete.