I am working on a project in angular2 and curious to know if there is any mean by which I can use angularjs functionalities in my angular2 application.
for ex.
in angularjs, I used to do following operations:
I just want to know that is there any module or package which can help me do above operations in angular2/typescript?
Thanks in advance.
Just use JavaScript:
Simple
typeof foo === 'string'
Simple
Array.isArray(value)
Simple
Object.assign({},value)
Except for copy
, angular2 actually provides the isString
and isArray
(and a lot more) functions from "@angular/common/src/facade/lang"
. To use these you have to import them like this:
import {isString, isArray} from "@angular/common/src/facade/lang";
But, the body of these functions are the same as basarat mentioned, and this import is no longer available. Sooo, use the solution above :)
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