I have this kind of issue, want to add some extra html stuff to html content, with conditional logic. But problem is that angular does not recognize angular syntax, which is added manually from component.
public isExist: boolean = false;
@ViewChild('appDropdown') appUnit: any;
ngOnInit(): void {
var el = this.appUnit._elementRef.nativeElement.querySelector('.list-area');;
el.insertAdjacentHTML('beforeend','<div class="list-item-container add-container">'
+ '<a class="btn btn-add" title="New">'
+ '<span>+</span>'
+ '</a>'
+ '<label *ngIf="isExist" class="item-label add-label">Add</label>'
+ '</div>');
}
This is a fragment of code. I mean that *ngIf is not recognize by angular.
How could I do this, that angular be able to recognize it's own syntax at such times?
For more clarity, I'm using this dropdown component, I want to add some extra features to it. I want to add footer with buttons, capable of saving and editing records on it. But unfortunately it does not supports this kind of customization and my try is on initialization access to dropdown body and add this html manually from component

insertAdjacentHTML,innerHTMLand the likes