add timer and mock for angularjs