This is the templating function for the custom directive which I have created.
The string str passed to the function obtainDynamicField(str) is coming as undefined. Also str is a string and not a variable.
function getTemplate() {
return
' <td>' +
' <div class="inner">' +
' <input type="text" ' +
' class="form-control" ' +
' data-dynamic-field="obtainDynamicField(str)"'+
' data-ng-model="formdata.product" >' +
' </input>' +
' </div>' +
' </td>' +
I am struggling for the past 2-3 hours in this. I think I need to escape out the str which I am unable to think so far on how to achieve it. Kindly suggest.
'data-dynamic-field="obtainDynamicField(\'str\')"'?