Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent of angular.isFunction in angular 2

In angular 1.x we use this angular.isFunction function to determines if a reference is a Function. What is the equivalent of that function in Angular 2. Checked in doc. But did not get anything.

Also please suggest the equivalent functions of this list in angular 2

like image 324
bCliks Avatar asked Jun 30 '16 08:06

bCliks


1 Answers

You can use the JS typeof operator:

typeof x === 'function'
like image 169
Günter Zöchbauer Avatar answered Oct 20 '22 01:10

Günter Zöchbauer