I am using JQuery UI popup. On click of "OK" button, I am calling an Angular function,
Sample code below.
$('#dialog-sample').dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "blind",
duration: 1000
},
resizable: false,
width: 500,
buttons: {
Save: {
id: 'btnSampleSubmit',
text: 'Submit',
click: function() {
var myScope = angular.element($('#myID')).scope();
myScope.myFunction();
}
},
Cancel: {
id: 'btnSaveWorkSpaceCancel',
text: 'Cancel',
click: function() {
$(this).dialog("close");
}
}
}
});
Also I have created the function "myFunction" inside the controller which is related to the element which has id "myID".
Error getting :
"function expected" in the console
I am using IE.
angular.element('#myID').scope();should be fine. On which line you get error ? can you post the full error ?