Accessing private property with decorator in typescript

1

In Typescript, is it possible to access a private property by the decorator? An example of the code I've already done

class A {
    @dec
    private _teste: string = 'teste'
constructor(){}
public get teste() { return this._teste + '1' } }

function(target: any, key: string){
    const value = target[key]  //sempre retorna undefined
}

In decorator I can not access neither the value nor the property itself. Is there any way I can access and manipulate the _test property?

    
asked by anonymous 02.01.2019 / 23:31

0 answers