Chess Clock Implementation in Angular.js