Search code examples
javascriptangularjsangular-formly

angularjs fomly - error with vars in templates


I can't display model or other variables in my template - http://jsbin.com/wofulinufo/edit?html,js,output.

question: how fix for display variables from controller?

if I write {{model}} or {{vm.model}} - it don't work.


Solution

  • You were overwriting your model with vm.model = {}. Here's your example now working: https://jsbin.com/pivevu/edit

    Note, it is {{model}} because the template is compiled with the formly-field scope, not your controller's scope. See this example