I am newbie in Angular and struggling with a problem here. I have an input type text which is read only (through ng-readonly). I have a separate button on click of which I have to call a javascript function openPopup which opens a pop up and then I choose something on popup and on clicking ok on popup, we come back to main page and the readOnly text input is updated with some value.
My problem is I want to capture this text change event of input Text, read that text value and then do some action in Angular.
Although the text field value is getting changed, the corresponding ng-model data.currentLot is not getting updated. I tried putting ng-change, using $apply $watch, onchange event, but nothing seems working. Am I missing something very simple here.
<div class="form-group">
<input type="text" ng-readonly="'true'" ng-model="data.currentLot" class="form-control" id="chooseLotId" placeholder="">
<button type="submit" class="btn btn-default" onclick="openPopup('chooseLotId', false);">Search Lots</button>
Thanks to suggestion from instantNoodles, I was able to solve the problem. As soon as a selection was made from pop up, the pop up was getting closed and focus came to my input text. I captured the onfocus event and that solved my problem.