MyLibrary.MyModule =
(
function initialise() {
this.id = id;
this.c = document.getElementById(id);
this.ctx = this.c.getContext('2d');
this.properties = {
setup: {
backgroundColour: options.setup.backgroundColour || 'black'
},
scale: {
show: options.scale.show || true,
colour: options.scale.color || 'white'
},
}
console.log(properties.setup.baseFontSize);
}
)(id, options);
I'm calling this code using
new MyLibrary.MyModule('c',options);
but the 'id' and options seems to be not defined.
can someone help?
MyLibrary.MyModule = ( function( _id,_options) {return function initialise(id,options) { /* your function body */ }; })(id,options);, though I'm not sure if this was your reason for doing it that way.