Last active
October 30, 2015 09:37
-
-
Save stoffeastrom/f339b7d1f196f3945c40 to your computer and use it in GitHub Desktop.
Decorator sample
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
import {Aurelia} from 'aurelia-framework'; | |
import {Container} from 'aurelia-dependency-injection'; | |
export function toolBarItem() { | |
return (target)=> { | |
let container = Container.instance; | |
let aurelia = container.get(Aurelia); | |
console.log(aurelia); | |
} | |
} |
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
export function configure(config) { | |
console.log("configure"); | |
return config.plugin("test/test-decorator") | |
} |
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
import {toolBarItem} from "test/decorator"; | |
console.log("test-decorator"); | |
@toolBarItem() | |
export class ToolBar { | |
constructor() { | |
console.log("toolbar ctor"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment