formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.22k stars 405 forks source link

Watchers are not calling when key has a model with Square Brackets #742

Open gayanprasanna opened 7 years ago

gayanprasanna commented 7 years ago
//watch function
vm.callbacks.testWatch = function (field, newValue, oldValue, scope, stopWatching) {console.log('test watch')};

//ui model
{
          "key": "quotationVersion.quotationAttributes[170400000000009].quotAttValue",
          "type": `"input",`
          "templateOptions": {
            "label": "Value"
          },
          "watcher": {
            "listener": "vm.callbacks.testWatch"
          }
egucciar commented 7 years ago

have you tried "quotationVersion.quotationAttributes.170400000000009.quotAttValue"?

gayanprasanna commented 7 years ago

@egucciar Yes i have tried it before that.And it threw an error of ng-model.Probably because of having a number in the ng-model.

egucciar commented 7 years ago

As I might need this functionality as well, I'll keep this in mind and see if I can come up with a solution

gayanprasanna commented 7 years ago

Yeah sure thanks

On Wed, Sep 20, 2017 at 3:29 PM, Erica Gucciardo notifications@github.com wrote:

As I might need this functionality as well, I'll keep this in mind and see if I can come up with a solution

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/formly-js/angular-formly/issues/742#issuecomment-330805306, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyhIT-WHarJGXbw3nSWfJFV0wCBHY49ks5skOHngaJpZM4OZ4RI .