implemented a timer, using $timeout to update the scope every second. By using $timeout we also update the ui, the supplied function is called with $apply by default