AngularJS helper functions instead of typeof