AngularJs:当我用,为什么不NG-开关更新NG-点击? [英] AngularJs: why doesn't ng-switch update when I use ng-click?

查看:148
本文介绍了AngularJs:当我用,为什么不NG-开关更新NG-点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着用 NG-点击更新 NG-开关使用的变量,但 似乎NG-开关不纷纷拿起变化。在这里看到的例子:
http://plnkr.co/edit/jx8DNlrJDuaUBKVwZQtQ

I tried using ng-click to update the variable used in ng-switch, but ng-switch doesn't seem to have picked up the change. See the example here: http://plnkr.co/edit/jx8DNlrJDuaUBKVwZQtQ

我在做什么错了?

推荐答案

您正在运行到范围继承的问题。请参阅: http://docs.angularjs.org/guide/scope

You're running into scope inheritance issues. See: http://docs.angularjs.org/guide/scope

修正版本:<一href=\"http://plnkr.co/edit/ENm5HBYno8yHblLlE8CA?p=$p$pview\">http://plnkr.co/edit/ENm5HBYno8yHblLlE8CA?p=$p$pview

这篇关于AngularJs:当我用,为什么不NG-开关更新NG-点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆