how to set dropdownlist ng-model after get ajax data
Sample my codes: http://dojo.telerik.com/@muratoner/icoBuB
1 Answer, 1 is accepted
0
Dimitar
Telerik team
answered on 18 Oct 2017, 08:53 AM
Hello Emre,
On the following Dojo example you can find a modified version of the code, where a default item is being selected in the DropDownList on load.
The currently provided Dojo example will work if we pass the id of the selected item (e.g $scope.model = 1) and the respective item will be selected on load. On the other hand, trying to set an object (e.g $scope.model = { ProductID : 1}) will not work, as ng-model binds the field contents and for the DropDownList, you get an integer instead of a JavaScript object. Using an object binding can be achieved by using k-ng-model as shown in the modified Dojo example above.
More useful information can be found in the links below: