0

Here's my scope:

$scope.form_state = { values: {

  title: 'Hello',
  body: {
    und: [ { value: 'World' } ]
  }

} };

Here's my view:

<input type="text" ng-model="form_state.values['title']" />
<textarea ng-model="form_state.values['body']"></textarea>

Hello is rendered properly in the text field, and [object Object] is rendered in the text area, which means there is at least something in there...

So why don't either of these ng-models work for placing World in the text area?

form_state.values['body["und"][0].value']
form_state.values['body.und[0].value']

1 Answer 1

2

Try accessing it like this:

form_state.values['body'].und[0].value

DEMO

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.