Skip to content

Commit cb85479

Browse files
added content component
1 parent ad56de3 commit cb85479

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import { AppComponent } from './app.component';
1111
import { NavComponent } from './core/nav/nav.component';
1212
import { BoardComponent } from './board/board.component';
1313
import { TaskCardComponent } from './board/shared/task-card/task-card.component';
14+
import { ContentComponent } from './core/content/content.component';
1415

1516
@NgModule({
1617
declarations: [
1718
AppComponent,
1819
NavComponent,
1920
BoardComponent,
2021
TaskCardComponent,
22+
ContentComponent,
2123
],
2224
imports: [
2325
BrowserModule,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.content{
2+
width: 100%;
3+
height:100%;
4+
position: fixed;
5+
}
6+
7+
.board-tabs{
8+
height: 100%;
9+
overflow-y:scroll;
10+
}
11+
12+
13+
.mat-tab-list{
14+
background-color: rgba(25, 199, 124, 0.83) !important;
15+
}
16+
md-tab-body{
17+
background-color: white !important;
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<md-tab-group class="content">
2+
<md-tab *ngFor="let board of boards" class="board-tabs">
3+
<ng-template md-tab-label>{{board.title}}</ng-template>
4+
<app-board [boardid] = "board.id"> Loading...</app-board>
5+
</md-tab>
6+
<md-tab>
7+
<ng-template md-tab-label><md-icon>add</md-icon></ng-template>
8+
</md-tab>
9+
</md-tab-group>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { ContentComponent } from './content.component';
4+
5+
describe('ContentComponent', () => {
6+
let component: ContentComponent;
7+
let fixture: ComponentFixture<ContentComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ ContentComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(ContentComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { TasksService } from '../../services/tasks.service';
3+
4+
import { BoardModel } from '../../models/board-model';
5+
6+
@Component({
7+
selector: 'app-content',
8+
providers: [TasksService],
9+
templateUrl: './content.component.html',
10+
styleUrls: ['./content.component.css']
11+
})
12+
export class ContentComponent implements OnInit {
13+
boards: BoardModel[];
14+
15+
constructor( private taskService: TasksService ) {}
16+
17+
ngOnInit(){
18+
this.getBoards();
19+
}
20+
21+
getBoards() {
22+
this.taskService.getBoards()
23+
.subscribe(
24+
boards => this.boards = boards,
25+
err => console.log(err)
26+
);
27+
}
28+
}

0 commit comments

Comments
 (0)