I have implemented a Bootstrap confirmation that appears to the user. After the confirmation is clicked, I am trying to access an observable array (this.parameters()) within the same class in the onCancel method. I have tried multiple methods without success. Any assistance would be greatly appreciated.
export class ViewModel {
public parameters: KnockoutObservableArray<Parameter>
constructor() {
this.parameters = ko.observableArray(new Array<Parameter>());
$('div.panel-footer button[data-toggle=confirmation]').confirmation({
placement: 'top',
href: '#',
title: 'Add Parameter',
btnOkLabel: 'Save & Resend Email',
btnOkIcon: 'glyphicon glyphicon-envelope',
btnOkClass: 'btn btn-sm btn-primary',
btnCancelLabel: 'Save',
btnCancelIcon: '',
btnCancelClass: 'btn btn-sm btn-primary',
onCancel: (e, target) => {
this.parameters();
}
});
}