Challenge: MVVM Pattern
Explore how to apply the MVVM architectural pattern to create a dynamic color-changing input field. Learn to define model functions for observing changes and implement ViewModel binding to update the view based on user input, enhancing your understanding of reactive design patterns in JavaScript.
We'll cover the following...
We'll cover the following...
Problem statement
In this challenge, you need to use the MVVM pattern to change the color of the “color” you write in the input field.
In the Model, you need to define the following functions:
-
subscribe: Registers an observer -
notifyObservers: Notifies the observer of a change -
...