Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

We have a form on submission of which we show a modal dialog. The modal also contains a form, whose values i am trying to retrieve.

I can get the value using ng-model, but in case of validation failure, it returns undefined. In those cases I am trying to get the value by using $viewValue like

$scope.formName.fieldName.$viewValue  

This works on the main page, but in the modal i am getting an error

Cannot read property 'fieldName' of undefined

i am using angular-ui-bootstrap for the modal.

jsfiddle : http://jsfiddle.net/agadbnLr/2/

Why i am not able to get the field value in the modal using $viewValue, whereas it is possible to get the field value which directly in the page.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.