Angularized Javascript