javascript - Clicking on Angular UI Bootstrap Radio Buttons - Stack Overflow

I'm trying to use the radio buttons implemented in UI Bootstrap firing a function by including a n

I'm trying to use the radio buttons implemented in UI Bootstrap firing a function by including a ng-click on the button. Apparently the radio button variable updates after the function has been called. I've created a Plunker to show this behaviour and explain the problem where the function fires an alert with the content of the variable.

Radio Buttons Plunker

Is there a simple way of solving this issue. Maybe by making the function to wait for the variable to update...

I'm trying to use the radio buttons implemented in UI Bootstrap firing a function by including a ng-click on the button. Apparently the radio button variable updates after the function has been called. I've created a Plunker to show this behaviour and explain the problem where the function fires an alert with the content of the variable.

Radio Buttons Plunker

Is there a simple way of solving this issue. Maybe by making the function to wait for the variable to update...

Share Improve this question asked Jun 25, 2014 at 0:26 prl900prl900 4,1794 gold badges35 silver badges42 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Yep, simple fix. Use ng-change instead of ng-click on your radio buttons.

See http://plnkr.co/edit/0Jf4qrpHAXY8MeeVA3kl?p=preview

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744097631a4558235.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信