javascript - Unexpected number when passing value in AngularJs -


i getting below error when passing value $scope.formdata.field_happy.und.0.value.

uncaught syntaxerror: unexpected number

but if passing binding model seems work. can't figure out doing wrong.

<input type="checkbox"  ng-model="formdata.field_staff_interaction.und.0.value" > 

this posting drupal services api endpoint. format need.

in javascript can't myarray.0. instead, should myarray[0]. so, in case, correct form is:

$scope.formdata.field_staff_interaction.und[0].value 

it "works" ng-model because directive has syntax, in myarray.0 valid.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -