Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Conversation

@cbourgois
Copy link
Contributor

fix(oui-select-picker): update when model changes

Description of the Change

c1f51a0 — fix(oui-select-picker): update when model changes

/cc @jleveugle @frenautvh @antleblanc @marie-j @AxelPeter

}
}

this.$scope.$watch("$ctrl.model", (newValue) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be made through $onChanges hook ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it doesn't work.

Copy link
Contributor

@AxelPeter AxelPeter Mar 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because of the binding of the model (=) :)

Could you prefer using a function instead ?

Suggested change
this.$scope.$watch("$ctrl.model", (newValue) => {
this.$scope.$watch(() => this.model, (newValue) => {

}
}

this.$scope.$watch("$ctrl.model", (newValue) => {
Copy link
Contributor

@AxelPeter AxelPeter Mar 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because of the binding of the model (=) :)

Could you prefer using a function instead ?

Suggested change
this.$scope.$watch("$ctrl.model", (newValue) => {
this.$scope.$watch(() => this.model, (newValue) => {

@cbourgois cbourgois force-pushed the fix/select-picker-update branch from c1f51a0 to 49f65f7 Compare April 3, 2019 12:40
@AxelPeter AxelPeter merged commit a59bf96 into develop Apr 3, 2019
@AxelPeter AxelPeter deleted the fix/select-picker-update branch April 3, 2019 12:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

4 participants