Use angular.isFunction
Throw error if no key is specified