javascript - angularjs fomly - 模板中的变量错误

标签 javascript angularjs angular-formly

我无法在模板中显示模型或其他变量 - http://jsbin.com/wofulinufo/edit?html,js,output

问题:如何修复 Controller 中的显示变量?

如果我写 {{model}}{{vm.model}} - 它不起作用。

最佳答案

您正在使用 vm.model = {} 覆盖您的模型。这是您现在正在运行的示例:https://jsbin.com/pivevu/edit

注意,它是 {{model}} 因为模板是使用 formly-field 范围编译的,而不是 Controller 的范围。请参阅this example

关于javascript - angularjs fomly - 模板中的变量错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33614594/

相关文章:

javascript - 尝试做过滤器时如何正确构造 reducer ?

angularjs - 在 AngularJS 中,为什么约定命名工厂服务

javascript - 只允许 6 位数字或 8 位数字(保留 2 位小数)

javascript - 将 ng-class 属性放入 Angular-formly 字段

javascript - 我可以在 Internet Explorer 中将整个 HTML 文档加载到文档片段中吗?

javascript - extjs 触发器字段不触发模糊

javascript - 如何清除所有同名的单选按钮。我想将名称作为变量传递

angularjs - 为什么 Angular Material2 使用 ViewEncapsulation.None 而不是 Emulated 或 Native?

javascript - AngularJS 创建 Controller

javascript - 在用户移出该字段之前,正式字段不会显示验证