Skip to content

Instantly share code, notes, and snippets.

@stoffeastrom
Last active October 30, 2015 09:37
Show Gist options
  • Save stoffeastrom/f339b7d1f196f3945c40 to your computer and use it in GitHub Desktop.
Save stoffeastrom/f339b7d1f196f3945c40 to your computer and use it in GitHub Desktop.
Decorator sample
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);
}
}
export function configure(config) {
console.log("configure");
return config.plugin("test/test-decorator")
}
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