javascript - angularjs ng-include 里的 ng-model 只在当前 ng-include 内有效?

查看:130
本文介绍了javascript - angularjs ng-include 里的 ng-model 只在当前 ng-include 内有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

项目头部通过 ng-include 引用,内有一个 input 并添加了 ng-model

经测试 只在当前 ng-include 内有效

把值拿出来放到别的地方就没反应了

有什么方法可以解决?

问题代码

@leftstick

解决方案

上代码吧,似乎是$scope不对

修改:

OK,看到问题了,我修正了你的代码:plunker

这篇关于javascript - angularjs ng-include 里的 ng-model 只在当前 ng-include 内有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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