replace jquery manipulation of game history to angularjs directive