ionic ng-model controller中取不到值(input)
解决方法
controller中定义一个集合:
$scope.data ={
text1 : "",
text2: "",
}
页面中分别定义 ng-model="data.text1",ng-model="data.text2"。
在controller中直接取$scope.data.text1就能得到<input>或者<textarea>中的值了
原理
ng-model取不到值是因为$scope作用域的问题
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇: java中各种变量
- 下一篇:没有了
