Skip to content

Commit

Permalink
add next tab directive
Browse files Browse the repository at this point in the history
  • Loading branch information
tenowg committed Mar 21, 2016
1 parent d452409 commit 2d808fb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-tabs",
"version": "0.1.0",
"version": "0.1.0-beta.0",
"description": "Tabs for angular2",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
16 changes: 16 additions & 0 deletions ts/src/next-tab-component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {Directive, Input} from "angular2/core";
import {AngularNavTab} from "./tab-directive";

@Directive({
selector: "[anNextTab]",
host: {
"click": "onClick()"
}
})
export class NextTab {
@Input("anNextTab") nextTab: AngularNavTab;

onClick() {
this.nextTab.anTabs.list.onClick(this.nextTab);
}
}
3 changes: 2 additions & 1 deletion ts/src/tab-directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {AngularNavTabs} from "./tabs-component";

@Directive({
selector: "[anTab]",
inputs: ['anTab']
inputs: ['anTab'],
exportAs: 'anTab'
})
export class AngularNavTab {
canActivate: Function = () => {return true;};
Expand Down

0 comments on commit 2d808fb

Please sign in to comment.