Angular refactor

Refactored code to use AngularJS.
constant