ReferenceError: timbreController is not defined

0

I'm trying to generate nodejs code, but it sends me the following error

module.exports = {
oninit : function (vnode) { 
  this.ctx = new timbreController(vnode.attrs); 
},
view : function (vnode) { 
  return facturaView(this.ctx) 
   }
};

function timbreController(Params) {
var ctx = this;
var search = m.prop('');
console.log(location);
}
function facturaView(ctx){
console.log(ctx);
}

and it throws me the next error

  

"ReferenceError: timbreController is not defined       at eval (eval at view etc .......

    
asked by Akira Uchiha 23.01.2018 в 21:12
source

1 answer

0

The function timbreController is defined outside the module (the one you export), they are in different contexts and therefore you do not find it as defined, you could create it within the module if it does not cause problems the capture of the this you make.

    
answered by 23.01.2018 в 21:19