Widget clone - Could not save record because of a compile error

larsbowassini
Kilo Expert

I have made a clone of the "SC Categories" widget, but I can't save it because of an error in a part of the script I haven't changed. It's in the Client controller field:

find_real_file.png

I get the error "Missing name in function declaration" - but the original widget uses this code - so what can I do?

1 ACCEPTED SOLUTION

Arnoud Kooi
ServiceNow Employee
ServiceNow Employee

If you scroll down and click on the UI Action: "Open in Widget Editor"



find_real_file.png




You will be able to save it in the new window that opens.



find_real_file.png


View solution in original post

7 REPLIES 7

ColeM
Tera Expert

I was able to get rid of the error by adding 

api.controller = 

before the function 

api.controller = function() {
}

 

GalSh
Tera Contributor

Hi , 

After cloning the widget :

at the client section add this : "api.controller=" at the beginning : 

api.controller=function ($scope, spUtil, $rootScope...) {}
 
in the link section add the name "link" to the function :
function link(..){
}

GalSh
Tera Contributor

change client and link section to this :