last day (14 days later) » 

11:58 AM
0
A: Ionic AngularJS ng-value not working

Pankaj BadukaleCan you please try this:: <input **name="user_id"** type="text" ng-model="data.userID" /> Why? ng-value is directive which manage Value of input so there is no need to add value attribute to input when you are using ng-value.. and ng-value angular directive which accept expression so no...

 
That seemed to half work. Its showing the value in the view. However on submit its not being passed through
 
are you getting userID in alert?
 
Yes, however its undefined. Yet on inspect element the ID is passed into the input
 
i have added name attribute which was missiong...can you check now
 
Tried that, no luck either
I tried ` <input id="searchType" type="text" name="searchTyp" ng-model="data.userID" ng-init="data.userID='{{chats.userID}}'" style="display: none;"> ` And that seems to work, the value is in the html. But on submit the value is just the text {{chats.userID}}
 
11:58 AM
<input id="searchType" type="text" name="searchTyp" ng-model="data.userID" ng-init="data.userID=chats.userID" style="display: none;">try this we almost there
 
Thank you so much!! ^_^
 
Hi, that worked perfectly thank you :)
 
ok great
i think you are new to angular js
as well why you want to submit form in this way
insude button we have input
 
Yeah I am, needed to go down the angularjs and ionic route for an app im working on. I tried ng-submit on the form div, but that didn't work so had to use a button for the time being
 
12:05 PM
but this html structing is not ok i think
as i said we have input inside a button
can i suggest new html structure to you
like
<form>
<input type="hidden"/>
<button></button>
<form>
in this way
 
Okay I'll change the html thank you
 
12:17 PM
I dont suppose you could help me with another bug?
 

last day (14 days later) »