Angular 2 equivalent of Angular 1's angular.isArray, angular.isDefined, etc. ?

1,606 views
Skip to first unread message

Fred Morrison

unread,
Aug 6, 2016, 11:45:34 AM8/6/16
to AngularJS
What is the Angular 2 equivalent of Angular 1's built-in angular.isArray, angular.isDefined, etc., as documented at the example Angular 1 link shown below?

I have searched the Angular 2 documents and the migration guide, but have not found the answer.

My best guess is that I have to do some type of import, but from where?

The Angular 1 to Angular 2 migration documentation is missing this vital piece of information (or it's hidden in an non-obvious location).

Lucas Lacroix

unread,
Aug 6, 2016, 12:01:45 PM8/6/16
to AngularJS

These are already part of Javascript.
Array.isArray(x) - static method of the array class
object.hasOwnProperty('name') - member function of all classes


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Fred Morrison

unread,
Aug 8, 2016, 12:05:18 PM8/8/16
to AngularJS
Thanks for the answer about isArray, but that means going outside of Angular2.

Do you know the Angular2 *BUILT-IN* equivalent of the following Angular1 built-in functions?

angular.isDate()
angular.isNumber()
angular.isString()
angular.merge()
angular.toJson()
Reply all
Reply to author
Forward
0 new messages