-1
   <apex:inputField id="lookup" value="{!surveyObj.User__c}" style="width: 300px;" html-placeholder="select The User from the Lookup"><br/><br/>

this is the lookup to user, and i wanna get that value in AngularJs...i

in the below code i am able to get the data for input type="text"

<input maxlength="100" type="text" required="required" class="form-control" placeholder="Enter Last Name"  ng-model="lastName"/>

so here i am using ng-model="lastName" for this so i can able to get the input value.

But the above code (1st or 2nd line) i am using <apex:input filed......> so,Here i am facing the challange....could any one pls help me out here.

1

You can get the value by as html-ng-model="lastname":

<apex:inputField id="lookup" value="{!surveyObj.User__c}" style="width: 300px;" html-placeholder="select The User from the Lookup" html-ng-model="lastname">

Or
As an alternate solution you can bind the apex input field by jquery on change. So, by change event just copy the value to hidden html input field which has ng-model=lastname and use it in $scope

| improve this answer | |
  • html-ng-model worked for me, Thank You So Much Rob – mujeeb Aug 26 '15 at 13:21
  • This gives you the text value, but not the value of the Id. How did you get the Id value? @mujeeb – TemporaryFix Jul 12 '17 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.