I am trying to populate table for which code is generated from the api with input and the formulas to calculate and display in other input which is working perfectly in angular 1.2 with .net core, I want to do same in angular 4 in there any solution. I tried following code but it's inserting as string. Let me be more specific, i have some master from which dynamic table has to be created which should look like Excel and one col will have Main Master like Name,department,designation grade against 12 col will be created for 12 months under months again there is some masters like basic salary, allowance, TA/ DA, other Allowance , PF like that for every month, every row at end of the month should calculate the sum, every grade should have total and every department should have total. so for the same all html code is getting generated from the back end which should append to front end from ajax and all calculation should work. i am able to achieve same with angular 1.2 but want to achieve the same with angular 4
@ViewChild('abcd')
private abcd: ElementRef;
constructor(private renderer: Renderer2) {
}
onClick() {
const li = this.renderer.createElement('li');
const text = this.renderer.createText('Click here to add li');
this.renderer.appendChild(li, text);
this.renderer.appendChild(this.abcd.nativeElement, li);
}
but not getting result, in angular 1.2 i am achieving the same with just
$('#xxx').append($compile(json)($scope));
$scope.$apply();