Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created April 28, 2019 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/77a2ebc29550144de4b572b53094e0e7 to your computer and use it in GitHub Desktop.
Save jasongorman/77a2ebc29550144de4b572b53094e0e7 to your computer and use it in GitHub Desktop.
export function HoursMinsSecsView(clock, element) {
clock.addObserver(this);
this.clock = clock;
this.element = element;
this.update = () => {
this.element.innerHTML = " <div class=\"row\">\n" +
" <div class=\"col-sm-4\">\n" +
" <p>Hours: </p> " + this.clock.hours + "\n" +
" </div>\n" +
" <div class=\"col-sm-4\">\n" +
" <p>Minutes: </p> " + this.clock.mins + "\n" +
" </div>\n" +
" <div class=\"col-sm-4\">\n" +
" <p>Seconds: </p> " + this.clock.secs + "\n" +
" </div>\n" +
" </div>\n"
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment