simple client script is not working in widget???

Shantharao
Kilo Sage

Hi All,

 

I am new to the service portal, just started practical learning on it, I am creating a simple custom widget with simple client script as below, getting an error as highlighted in the red color,  

 

Can someone provide me the useful URL/Documents or Youtube videos for a custom widget creation?

 

// Client script
function(spModal) {
var c = this;
c.onAlert = function () {
spModal.alert('How do you feel today?').then(function (answer) {
c.simple = answer;
});
}
}

 

It should contain a JavaScript function

 

Screenshot for reference

find_real_file.png