I know in javascript, I can create an element in below way.
var input = document.createElement("input");
input.type = "text";
input.className = "css-class-name"; // set the CSS class
document.body.appendChild(input);
In my angular application, I'm getting some array value from http service inside ngOnInit of app.component.ts.
I have a scenario to create the input type text dynamically based on array value. If the array value is 5, it should create five input type.
Is it possible with typescript? Or should I use the above code in typescript as well?
What is the best approach to deal this scenario?
createElementand the like. You probably want to create an array of 5 elements, and bind an*ngForto that.