AngularJS extensions for type checking