Closed
Description
function Decoration() {}
function PropertyDecoration(target: any) {
console.log(target);
}
@Decoration
export class ClassName {
@PropertyDecoration
property: string = 'null';
}
compiles to:
function Decoration() { }
function PropertyDecoration(target) {
console.log(target);
}
let ClassName = class {
constructor() {
this.property = 'null';
}
};
However this means that the console.log result will be {}
. Removing the @Decoration
class decorator outputs:
function PropertyDecoration(target) {
console.log(target);
}
class ClassName {
constructor() {
this.property = 'null';
}
}
with the better console.log result of ClassName {}
.