$location服务,获取页面跳转带的参数
比如说页面是这样的 localhost:9102/admin/goods.html#?id=123 如何获取这个id=123的值呢?????(注意:angularJs页面跳转必须是#?key=val 这种 切记)
- 在controller 中引入 $location 服务
- 在需要的方法中添加这样一句话就ok var id=$location.search()['id']; 便可以得到id=123 了。
ng-checked 指令
ng-checked=true 表示被选中,false表示未选中