angular-autoFields-bootstrap
angular-autoFields-bootstrap copied to clipboard
Create custom field select and ng-selected
hello i want to create a custom select element i have my data like this : "list": [ { "id": "lhEMz6vl", "name": "Qualit\u00e9" }, { "id": "EFJzlnk8", "name": "Hygi\u00e8ne & Sant\u00e9" }, ] i want my data appear in the exact position as in the original dataset
this is my directive, but the ng-selected do not work
TetxDirective.config(['$autofieldsProvider', function($autofieldsProvider){
// Checkbox Field Handler
$autofieldsProvider.registerHandler('select_adv', function(directive, field, index){
console.log(field);
var current_value = field.value;
console.log("current_value " + current_value);
console.log("list " );
var fieldElements = $autofieldsProvider.field(directive, field, '<select id="{{field.name}}" name="{{field.name}}" ng-model="list[0][\'foldertool_data\'][\'list\'][0] " ng-options="option as option.name for option in list[0][\'foldertool_data\'][\'list\'] " > </select>' );
return fieldElements.fieldContainer;
});
}]);
Hey @openmotion I'm not sure I understand what you're trying to do. Can you show me with just normal HTML or something?
If I am understanding correctly I think you are using a special handler when you don't really need one.