I wonder if there is any way to achieve the event and the property binding without using parenthesis or brackets?
Reference : https://angular.io/docs/ts/latest/guide/template-syntax.html#!#event-binding
<input [value]="currentHero.firstName"
(input)="currentHero.firstName=$event.target.value" >
- In Angular2 for event-binding we need '(event-type)', looking for some way to perform the same
- In Angular2 for property-binding we need '[property-value]', looking for some way to perform the same functionality.
Can this be done the way normal DomElements, because '[]' & '()' is not a valid Html attributes..!
Edit:
function:
getDomElement(model:Object){
//...some logic to control the elemet generation
return {text-type-InputElement};// ..only returns elemnts(eg: <input type="text"/>)
}
var type = getDomElement(elem).type; // .. will give us TEXT
var tagName = getDomElement(elem).tagName;//.. will give us INPUT
Using the above returned DomElement, I am trying to perform element.setAttribute("[(ngModel)]","model.firstName").
Which is not possible, any alternatives to achieve this.