Olá, estou com um problema na tag view, segue abaixo o erro:
Uncaught TypeError: Cannot read property 'negociacoes' of undefined
at NegociacoesView.template (NegociacoesView.js:22)
at NegociacoesView.update (View.js:14)
at new NegociacaoController (NegociacaoController.js:15)
at index.html:59
Por algum motivo estou tendo um erro quando tento fazer um map no negociacoesView. Acredito que o problema esteja na instancia de "_listaNegociacoes", mas não consigo identificá-lo. Segue abaixo a instância e o método "create" de "ProxyFactory":
this._listaNegociacoes = ProxyFactory.create(new ListaNegociacoes(),
['adiciona', 'esvazia'],
(model) => this._negociacoesView.update(model))
static create(objeto, props, acao){
new Proxy(new ListaNegociacoes(), {
get(target, prop, receiver) {
if(props.includes(prop) && typeof(target[prop]) == typeof(Function)) {
return function() {
console.log(`interceptando ${prop}`);
let retorno = Reflect.apply(target[prop], target, arguments);
acao(target);
return retorno;
}
}
return Reflect.get(target, prop, receiver);
}
});
}
Perdão por qualquer erro gramatical : )