1

I need it iterate through different objects while making forms at the same time and the way I thought of handling the submit was to use this:

<form (ngSubmit)="submitForm{{u}}()">

The issue is that I cannot figure out how to get the index (u) to get into the string without throwing an error.

Parser Error: Got interpolation ({{}}) where expression was expected

I know that

(ngSubmit)={{u}}

Would work but I also need the function name.

Thanks

1 Answer 1

2

You do not need {{}} as the error says , it should be

<form (ngSubmit)="submitForm(u)">
Sign up to request clarification or add additional context in comments.

4 Comments

would this work for what I need to do with getting data from multiple different forms or is there a better way of going about this?
What do you mean by multiple forms ?
I have a list of users that when edited need to be saved to the data base and I have it so that each one creates a form for them self my plan was that when confirm is clicked I would handle the logic in the .ts file my only issue is I'm not sure how to get the data back and forth. I am starting to think this is the wrong way of going about this
go for dynamic forms here is the link angular.io/guide/dynamic-form. Where you will get the values attribute to save the data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.