I've shown part f the code because it is a big controller and view. I'm trying to pass k-options with data to the modal but it isn't set.
vm.subItemOptions = {};
vm.editPlanSubItem = function() {
// some custom logic to get the data
var params = {
planItems: planItems,
child: child,
index: index,
key: key
};
vm.subItemOptions = params; // trying to pass data to modal unsuccessfully
vm.editPopup.center();
vm.editPopup.open();
}
<div ng-controller="MainCtrl as vm">
<div class="demo-section k-content">
<button class="k-button" ng-click="vm.editPlanSubItem()">Edit</button>
</div>
<div kendo-window="vm.editPopup" k-options="vm.subItemOptions"
k-width="600" k-height="200" k-visible="false"
k-content="{ url: siteURL + '/public/scripts/views/edit-sub-item.html'}"
k-on-open="win2visible = true" k-on-close="win2visible = false"></div>
</div>
Part of the modal view edit-sub-item.html is:
<div class="modal-dialog small-dialog" id="modal-edit-sub-planner">
<div class="modal-content">
<div class="color-line"></div>
<div class="modal-header">
<h3 class="modal-title" ng-bind="message"></h3>
<div class="row">
<div class="col-md-12">
<label class="item-goal">Goal</label>
<div class="plan-items-td">
<input ng-disabled="params.planItems[0].Status === 'Approved'" type="text"
class="k-textbox plan-items"
ng-model="params.planItems[params.index].children[params.key].Goal">
</div>
</div>
</div>
//other code
</div>
</div>
</div>
How could I pass params to the modal?