With Kendo UI component in Angularjs, for example:
<input kendo-date-picker="myDatePicker"
ng-model="dateString"
k-ng-model="dateObject"
style="width: 100%;" />
I am able to access the date picker in javascript with the variable $scope.myDatePicker
Now, the problem is, this date-picker comes with a wrapper with the tag ng-switch-when
.
<div ng-switch="userSelection.code">
<div ng-switch-when="JUST_DEMO">
<input kendo-date-picker="myDatePicker"
ng-model="dateString"
k-ng-model="dateObject"
style="width: 100%;" />
</div>
</div>
With this, in the javascript, the variable $scope.myDatePicker
becomes 'undefined
', even though after the flag JUST_DEMO
is turned on subsequently.
So my question is, how to fix this? I need to access $scope.myDatePicker
in javascript to manually open the datepicker in the code.
P.S.:
I think I found a working approach: using $compile
in the databound
event.