In a new ScriptLab's JavaScript project, I added the following library to get Office UI Fabric functionality:
https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.2.0/js/fabric.min.js
So I wrote this script (just pay attention to the fabric
word):
var ChoiceFieldGroupElements = document.querySelectorAll(".ms-ChoiceFieldGroup");
for (var i = 0; i < ChoiceFieldGroupElements.length; i++) {
new fabric['ChoiceFieldGroup'](ChoiceFieldGroupElements[i]);
}
I get red lines of error syntax in the fabric
keywords. I know that if the project were a TypeScript instead of a JavaScript one, I could write this in the top of the script to prevent this:
declare var fabric: any
However, what should I write in the top of JavaScript sections? I should add that the project runs normally, tough.