You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 {}.
The text was updated successfully, but these errors were encountered:
jamcoupe
changed the title
ES6 Class decoration output issue
ES6 class decoration output means property, method & parameter decorations can not get type information from target
Dec 31, 2015
compiles to:
However this means that the console.log result will be
{}
. Removing the@Decoration
class decorator outputs:with the better console.log result of
ClassName {}
.The text was updated successfully, but these errors were encountered: