I have existing javascript function which is used to create dynamic element using setAttribute function. Now I want to append attributes [(ngModel)] into this element for two way data binding. I tried to add this using
obj.setAttribute("[(ngModel)]", "modelName")
But I'm getting error-
Failed to execute 'setAttribute' on 'Element': '[(ngModel)]' is not a valid