-
Notifications
You must be signed in to change notification settings - Fork 647
Remove form element from multiple input field #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I need a gist of what you are doing to be able to help, an image doesn't provide enough information for anyone to support your issue. The example demo has a "Save to Gist" button you can use to create one from a schema and form definition. |
Scenario is like this. Initial, I have 'Add List' button then I click Add List button so if it display a new field with Input field with save button. It is possible to add any number of fields like that. Then, it is needed to input some thing on input filed and then click save. |
Take a look at the example page and look at the array example. You can add any field type inside an array including a button, by default the array will also have an X for removal and you can listen for Angular destroy events to capture the backend changes you need. Please re-open if you do not feel the question has been answered sufficiently :) |
Hi @Anthropic, what i need is, it needs to remove that particular array element which user click save button with out any user interaction. User clicks save button and that field is remove from the form array. How can i user angular destroy event for that ?? |
@anushkamahesh in that case you would have the function called by the save button handle it all, so you don't need the destroy event for that case, just call your save function and on confirmation from the server that it was saved, splice the item out of your array. |
Here is example view https://embed.plnkr.co/NT6cvVybfuZnFIhgU1Xm/. In order to slice in need to get the particular index of the array to the controller how can i do that |
@anushkamahesh there is a PR in progress #652 to help make this easier as it currently only works if the array is not nested. If it isn't nested then there is an arrayIndex value available to pass to your function, but I think that will work better one the above PR is merged. |
As a developer, when I save a value in particular input field (Refer attached image) I should be able to remove that whole element from the list. So is it possible to do it or is there any way to do that (I'm using latest version 0.8.13)
The text was updated successfully, but these errors were encountered: