add angular js to push view logic to javascript