Skip to content

Instantly share code, notes, and snippets.

@Mati365
Created July 20, 2015 13:46
Show Gist options
  • Save Mati365/ee86e150852f8c2350e9 to your computer and use it in GitHub Desktop.
Save Mati365/ee86e150852f8c2350e9 to your computer and use it in GitHub Desktop.
export class Tabs implements ng.IDirective {
public priority: number = 5000;
public terminal: boolean = true;
//public scope = {
// repeat: '@appTabs'
// , pages: '@appTabsLimit'
//};
constructor(
private $compile: ng.ICompileService) {
}
public compile: ng.IDirectiveCompileFn = (element: ng.IAugmentedJQuery, attr: ng.IAttributes) => {
attr.$set('ngRepeat', (<any> attr).appTabs);
let compiled = this.$compile(element, null, 5000);
return scope => {
compiled(scope);
};
};
static factory(): ng.IDirectiveFactory {
return $compile => new Tabs($compile);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment