This is a migrated thread and some comments may be shown as answers.

Broken ng-model binding in 2016.2.714

2 Answers 46 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 12 Sep 2016, 10:29 AM
Using the latest version in combination with angular 1.5.8 using components it appears that the multi-select doesn't show anything when i use an ng-model binding.
I created an example at http://dojo.telerik.com/@Marcel/osoHA/2 to show you the problem.
I know i can use k-ng-model to successfully bind, but that raises other problems in my application due to custom directives that require ng-model, angular validation, etc.

Is this a known (broken) issue and is there a workaround to solve this problem ?

2 Answers, 1 is accepted

Sort by
0
Marcel
Top achievements
Rank 1
answered on 13 Sep 2016, 09:44 AM
i eventually found out i can use the $postLink method to set the value of the multi-select so it reflects the ng-model.
vm.$postLink = function () {
  $scope.keySelector.value(vm.keys);
}

However, now i'm running into other problems using ng-required when the initial binding is an empty array.
It stays valid until i add and remove an item.       


0
Dimiter Topalov
Telerik team
answered on 13 Sep 2016, 03:24 PM
Hi Marcel,

Please check out the following section of our documentation for an explanation about the reported issue, and possible workarounds:

http://docs.telerik.com/kendo-ui/AngularJS/Troubleshooting/common-issues#widgets-with-ng-model-directives-reflect-no-model-value

I hope this helps.

Regards,
Dimiter Topalov
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
MultiSelect
Asked by
Marcel
Top achievements
Rank 1
Answers by
Marcel
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or