I'm migrating from AngularJS to Angular version 12 In AngularJS, I have the following operations:
angular.isObject(value) angular.isDefined(value) angular.forEach(value)
I want to know the alternatives in angular
Angular does not provide such methods. You can create your own replacements:
for angular.isObject you can do:
isObject(obj) {
typeof obj === 'object' && obj !== null.
}
for angular.forEach you have Object.entries which returns an iterable.
angular.isDefined is just
isDefined(obj) {
typeof obj !== null && obj !== undefined.
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With