我收到错误:ngModel:nonassign

时间:2017-10-23 21:26:00

标签: angularjs

我收到错误:

  

ngModel:nonassign但ngModel指令使用assignable绑定   表达式。

可能是什么问题?
我的代码如下:

String str; // store the text corresponding to  the RadioButton which is clicked 

   switch(view.getId()) {
                case R.id.radioButton1:
                    if (checked)
                     str = "button1Text";
                    break;
                case R.id.radioButton2:
                    if (checked) 
                     str = "button2Text";
                    break;
                case R.id.radioButton3:
                    if (checked) 
                     str = "button3Text";
                    break;
         }

            Intent intent = new Intent(this, WinderDTActivity.class);
            intent.putExtra("radioChosen", str); // pass "str" to the next Activity

起初工作。 (这是在html页面和javascript页面上)

1 个答案:

答案 0 :(得分:0)

<input ng-model="lastName"> 
{{ lastName }}
<span ng-bind="lastName">  </span>

$ scope.firstName =&#39; Ben&#39;;
$ scope.lastName =&#39;史密斯&#39 ;; }])