Get text from text field in modal example


#1

I have problems getting the value of text field from the example modal.
Following the example i have ng-model=“textField” in the HTML. And in app.js. The controller i put in the top div in the modal . When click on the button it triggers the function , because the model.hide() works, but obviously doesn’t get textField value.


#2

You need to use “dot notation”.

$scope.data.textField = '';

Then in you modal :

<input type="text" ng-model="data.textField" />