1

I have a form I'd like submitted as usual, so I stuck a non-bindable attribute on it. That works. But I have the need for a field to be filtered on input (specifically, converting a string to a clean version of itself on the fly, thus turning Some Input to some_input while it's still being typed) and this would be very easily achievable in Angular but since the entire parent element (the form) is non-bindable, Angular ignores all children.

I tried putting non-bindable on the submit button alone, but this produces no effect. How can I tell Angular to submit a form as usual, but to still allow angular directives and functionality inside said form, without resorting to vanilla JS and "onkeyup"?

2 Answers 2

1

On a more careful readthrough of the form API, I noticed this:

For this reason, Angular prevents the default action (form submission to the server) unless the element has an action attribute specified.

Specifying an action attribute was all it took. The form is now being submitted as usual, and I can use Angular within it.

Sign up to request clarification or add additional context in comments.

Comments

0

I haven't used non-bindable attribute, but I don't think that it is possible with angular to have non-bindable parent element and use data-binding with children elements at the same time.

I would forget non-bindable and instead solve your scenario by a doing regular angular $http request on form click. You can configure it to look the same as regular form submit. Or do you have any particular reason why you need browser to make your request from the form for you?

1 Comment

The client demands I keep the back end of the application I'm building old-school. I figured it out though, see answer.

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.