I'm running this code mentioned below in Angular 7.3.2, and I'm getting error
Cannot find name of 'of'
I tried searching about keyword of
in Angular couldn't find much information, can you please help if you have info about it
const nums = of(1, 2, 3);
const squareValues = map((val: number) => val * val);
const squaredNums = squareValues(nums);
squaredNums.subscribe(x => console.log(x));
you need to import it
import { of } from 'rxjs';
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