add angular js to push stat view logic to javascript