jquery - A bug occurs when setting a radio button prop('checked','true') in angulajs and then selecting another button
天蓬老师2017-05-15 16:50:24
0
1
701
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? ? ?
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!
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!