Skip to content

Instantly share code, notes, and snippets.

@jepetko
Created March 21, 2016 21:28
Show Gist options
  • Save jepetko/00806e50ecbd0ac9d538 to your computer and use it in GitHub Desktop.
Save jepetko/00806e50ecbd0ac9d538 to your computer and use it in GitHub Desktop.
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