I have created a multiselect with autocomplete directive its mapping the selected list to the ng-model of the directive . I want to get a single field value from the ng-model and assign that to another ng-model . I am not able to do that . If I am passing the whole ng-model value and assigning to another ng-model its working fine but with single field value it is not working.
Please find the link to the fiddler for the code -
<div ng-controller="TestCtrl">
<typeahead data-ng-model="selecteds" ng-change="emailId=selecteds.email" items="contacts" displaytag="name" displayitem="name">
</typeahead>
<input type="hidden" ng-model="emailId" />
{{emailId}}
</div>
I am not able to run the code in fiddle but its a running code in my system.
Can anyone please help me on how I can pass one field in an ng-model to another ng-model. In the {{emailId}} I should be getting the value '@pacman.com'.