A
A
Alexey Bondarev2016-11-28 09:07:08
Angular
Alexey Bondarev, 2016-11-28 09:07:08

How to pass parameter from form without ng-model?

I deal with Angular recently)
Situation:
Adding a comment to the news, I connect the text field and the user using ng-model, send it by POST, everything is sent. But I need to send the ID of the news to which the comment belongs! So I fell into a stupor! News on page 20, respectively, and 20 ID, I can get the ID itself, but how to send it to the add method ?! If I write the same way through ng-model, then by itself it is empty there! Here's a sample code!

<input type="text" ng-model='com.lnk' value="{{item.guid}}" />
Эл.почта <input type="text" ng-model='com.mail' /><br />
Текст <input type="text" ng-model='com.text' /><br /><br />

<input type="button" value="Отправить" ng-click='save(com)' />

It is necessary to pass item.guid to the method as a news identifier! Before that, I worked on JQ, but it should be somehow easier here! Tell me how?))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2016-11-28
@lexbond13

save(com, item.guid);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question