Undefined value in ng-option

时间:2016-07-11 20:12:59

标签: javascript angularjs

I write simple function in javascript

        $scope.changeItem=function (o) {
           console.log(o);
            var value = ($scope.formInfo.name);
            $scope.formInfo.positionId=value;
       }

I want use it in ng-change directive like this

  <select  ng-options="position.name for position in positionlist" id="inputPosition"  ng-model="formInfo.positionId"  ng-change="changeItem(position)">

but my script is printing undefined value on console.

0 个答案:

没有答案