I have this simple directive:
app.directive('string', function () {
return{
template: '<input id="{{field.name}}" name="{{field.name}}" type="text" value="{{field.value}}"/>',
restrict: 'E',
};
});
That I'm creating in a controller:
for(var i=0;i<$scope.steps;i++){
var step = $scope.steps[i];
var element = document.createElement(step.type);
var compiled = $compile(element)($scope);
$(document.body).append(compiled);
}
this outputs a textfield without a value. How can I give my directive the 'step' variable and print it out in the text field as step.value?