If you use Lodash , you can do the following:
Import Lodash into your component.
import * as _ from "lodash";
Declare a member variable in the component to reference Lodash.
lodash = _;
Then, in your opinion, you can use the range function . 20, you can replace any variable in your component.
*ngFor="let number of lodash.range(20)"
I must say that binding to functions in a view can be expensive, depending on the complexity of the function that you are calling, since Change Detection will call the function again.
Davy Jun 19 '18 at 7:54 2018-06-19 07:54
source share