Skip to content

Commit

Permalink
Adding decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
eavichay committed Apr 13, 2017
1 parent 15e8a57 commit ea6019f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Decorators.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export function tag(selector:string) {
return function(target:any):void {
window['Slim'].tag(selector, target);
}
}

export function template(tpl:string) {
return function(target:any):void {
target.prototype.__defineGetter__('template', () => {
return tpl;
});
}
}

export function useShadow(value:boolean) {
return function(target:any):void {
target.prototype.__defineGetter__('useShadow', () => {
return value;
})
}
}
Loading

0 comments on commit ea6019f

Please sign in to comment.