search

Home  >  Q&A  >  body text

jquery - A bug occurs when setting a radio button prop('checked','true') in angulajs and then selecting another button

Why is it that when you set a radio button prop('checked','true') in Angulajs and then select another button, the ng-model of the button has not changed, so it cannot be monitored? ? ?

天蓬老师天蓬老师2810 days ago716

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-15 16:52:24

    After an afternoon of brain-dead work, I finally found out why I still need to use jquery to operate the dom when I can directly use ng-model to control it. This can only show that my IQ was infinite at the time~~~Also, I can’t Because the monitoring is performed in the child scope, the object ng-model='object.xx' must be used instead of ng-model='xx'. Otherwise, changes in the child scope cannot change the parent scope. In fact, it is recreated. A value, which is related to the prototype chain of javascript. It’s just my fault that I didn’t see it clearly. It was all tears!

    reply
    0
  • Cancelreply