The below code generates the form dynamically. - This is written in Angular js 1.4
var $label = $('<label display="inline-block" width=25px>').text(jsonObj.ATTRIBUTES[key].ATTRIBUTE_NAME+' : ');
var $input = $('<input type="text">').attr({id: jsonObj.ATTRIBUTES[key].ATTRIBUTE_NAME+'Id', name: jsonObj.ATTRIBUTES[key].ATTRIBUTE_NAME, 'ng-model':'entity.'+jsonObj.ATTRIBUTES[key].ATTRIBUTE_NAME});
$input.appendTo($label);
$('#dynamicContent').append($label).append('<br/>');
Next this 'dynamicContent' id is there in the JSP as below
start form name="myForm" ng-submit="submitForm()"
div id='dynamicContent'
end form
Now, how do I make sure the form submits, and I will be able to access 'entity' in the controller?
PS: New to Angular and jQuery Please suggest how do I go ahead in case I just use Angular.