Created
July 6, 2021 12:15
-
-
Save guidani/973dd6325bf941b74b40caf928718888 to your computer and use it in GitHub Desktop.
erro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calcula{ | |
private _media14: number; | |
private _mediaDia: number; | |
constructor(media14, mediaDia){ | |
this.setMedia14(media14); | |
this.setMediaDia(mediaDia); | |
} | |
set setMedia14(valor:number){ | |
this._media14 = valor; | |
} | |
get getMedia14(): number { | |
return this._media14; | |
} | |
set setMediaDia(valor:number){ | |
this._mediaDia = valor; | |
} | |
get getMediaDia(): number { | |
return this._mediaDia; | |
} | |
} |
class Calcula{
private _media14: number;
private _mediaDia: number;
constructor(media14, mediaDia){
this.setMedia14(media14);
this.setMediaDia(mediaDia);
}
set setMedia14(valor){
this._media14 = valor;
}
get getMedia14() {
return this._media14;
}
set setMediaDia(valor){
this._mediaDia = valor;
}
get getMediaDia() {
return this._mediaDia;
}
}
Paro de ocorrer os erros após retirar os retornos, mas não sei se isso é correto.
outro erro ao chamar uma função
calculaVariacaoPercentual(){
// (VF / VI - 1) x100
let resultado: number = ((this.getMedia14 / this.getMediaDia)-1)*100
return resultado
}
this.setMedia14(media14);
^
TypeError: this.setMedia14 is not a function
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
erro acontecendo:
app.ts:17:10 - error TS2349: This expression is not callable.
Type 'Number' has no call signatures.
17 this.setMedia14(media14);
~~~~~~~~~~
app.ts:18:10 - error TS2349: This expression is not callable.
Type 'Number' has no call signatures.
18 this.setMediaDia(mediaDia);