re-implement application.js with angular