Created
March 21, 2016 21:28
-
-
Save jepetko/00806e50ecbd0ac9d538 to your computer and use it in GitHub Desktop.
This file contains 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 {Component, OnInit} from 'angular2/core'; | |
import {Tab} from './tab'; | |
import {TabService} from './tab.service'; | |
import {RouteParams} from 'angular2/router'; | |
@Component({ | |
selector: '[tabContent]', | |
template: `<div *ngIf="tab" class="panel panel-default"> | |
<div class="panel-body"> | |
<p class="active">{{tab.content}}</p> | |
</div> | |
</div>`, | |
styles: [`.panel { | |
border-top-width: 0px; | |
border-top-left-radius: 0%; | |
border-top-right-radius: 0%; | |
}`] | |
}) | |
export class TabContentComponent implements OnInit { | |
tab: Tab; | |
constructor(private _routeParams: RouteParams, private _tabService: TabService) { | |
} | |
ngOnInit() { | |
this._tabService.getTab(+this._routeParams.get("id")).then((tab: Tab) => { | |
this.tab = tab; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment