forked from ReactiveX/rxjs-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e83bb6
commit 5234038
Showing
13 changed files
with
280 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<mat-card> | ||
<mat-card-header> | ||
<div mat-card-avatar [ngStyle]="{'background-image': 'url(' + member.avatar + ')'}" class="header-image"> | ||
</div> | ||
<mat-card-title>{{member.name}}</mat-card-title> | ||
<mat-card-subtitle>{{member.role}}</mat-card-subtitle> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<p> | ||
{{member.bio}} | ||
</p> | ||
</mat-card-content> | ||
<mat-card-actions> | ||
<a *ngIf="!!member.githubUrl" mat-button [href]="member.githubUrl">GITHUB</a> | ||
<a *ngIf="!!member.twitterUrl" mat-button [href]="member.twitterUrl">TWITTER</a> | ||
<a *ngIf="!!member.linkedin" mat-button [href]="member.linkedin">LINKEDIN</a> | ||
<a *ngIf="!!member.email" mat-button [href]="member.email">EMAIL</a> | ||
</mat-card-actions> | ||
</mat-card> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.mat-card { | ||
width: 300px; | ||
margin: 15px; | ||
} | ||
|
||
.header-image { | ||
background-size: cover; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MemberComponent } from './member.component'; | ||
|
||
describe('MemberComponent', () => { | ||
let component: MemberComponent; | ||
let fixture: ComponentFixture<MemberComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ MemberComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MemberComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { IMember } from './team.models'; | ||
|
||
@Component({ | ||
selector: 'app-member', | ||
templateUrl: './member.component.html', | ||
styleUrls: ['./member.component.scss'] | ||
}) | ||
export class MemberComponent{ | ||
@Input() member: IMember; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
<p> | ||
team works! | ||
</p> | ||
<div style="background-color: white;" class="team-section"> | ||
<h2>Core team</h2> | ||
<section class="wrapper"> | ||
<app-member *ngFor="let member of (team$ | async).coreTeam" [member]="member"> | ||
</app-member> | ||
</section> | ||
</div> | ||
|
||
<div style="background-color: #efefef" class="team-section"> | ||
<h2>Learning team</h2> | ||
<section class="wrapper"> | ||
<app-member *ngFor="let member of (team$ | async).learningTeam" [member]="member"> | ||
</app-member> | ||
</section> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
h2 { | ||
text-align: center; | ||
margin: 0; | ||
padding: 20px; | ||
} | ||
|
||
section.wrapper { | ||
display: flex; | ||
flex-flow: row wrap; | ||
justify-content: center; | ||
} | ||
|
||
div.team-section { | ||
box-shadow: -1px 3px 5px 0px #d6d6d6; | ||
margin-bottom: 3px; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
import { TeamService } from './team.service'; | ||
import { ITeam } from './team.models'; | ||
|
||
@Component({ | ||
selector: 'app-team', | ||
templateUrl: './team.component.html', | ||
styleUrls: ['./team.component.scss'] | ||
}) | ||
export class TeamComponent implements OnInit { | ||
team$: Observable<ITeam>; | ||
|
||
constructor() { } | ||
constructor( | ||
private service: TeamService | ||
) {} | ||
|
||
ngOnInit() { | ||
this.team$ = this.service.getTeam(); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export interface ITeam { | ||
coreTeam: IMember[]; | ||
learningTeam: IMember[]; | ||
} | ||
|
||
export interface IMember { | ||
name: string; | ||
role: string; | ||
githubUrl: string; | ||
avatar: string; | ||
twitterUrl: string; | ||
linkedin: string; | ||
email: string; | ||
bio: string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { MatCardModule, MatButtonModule } from '@angular/material'; | ||
|
||
import { TeamComponent } from './team.component'; | ||
import { routing } from './team.routing'; | ||
import { TeamComponent } from './team.component'; | ||
import { TeamService } from './team.service'; | ||
import { MemberComponent } from './member.component'; | ||
|
||
@NgModule({ | ||
imports: [routing], | ||
declarations: [TeamComponent] | ||
imports: [ | ||
routing, | ||
CommonModule, | ||
MatCardModule, | ||
MatButtonModule | ||
], | ||
providers: [TeamService], | ||
declarations: [TeamComponent, MemberComponent] | ||
}) | ||
export class TeamModule { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { TestBed, inject } from '@angular/core/testing'; | ||
|
||
import { TeamService } from './team.service'; | ||
|
||
describe('TeamService', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [TeamService] | ||
}); | ||
}); | ||
|
||
it('should be created', inject([TeamService], (service: TeamService) => { | ||
expect(service).toBeTruthy(); | ||
})); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import 'rxjs/add/observable/from'; | ||
|
||
import { ITeam, IMember } from './team.models'; | ||
|
||
@Injectable() | ||
export class TeamService { | ||
getTeam(): Observable<ITeam> { | ||
return Observable.from([{ | ||
coreTeam: [{ | ||
name: 'Fredrik Lundin', | ||
role: 'Developer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Fredrik is a fullstack developer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stockholm, Sweden' | ||
}, { | ||
name: 'Fredrik Lundin', | ||
role: 'Developer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Fredrik is a fullstack developer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stockholm, Sweden' | ||
},{ | ||
name: 'Fredrik Lundin', | ||
role: 'Developer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Fredrik is a fullstack developer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stockholm, Sweden' | ||
},{ | ||
name: 'Fredrik Lundin', | ||
role: 'Developer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Fredrik is a fullstack developer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stockholm, Sweden' | ||
},{ | ||
name: 'Fredrik Lundin', | ||
role: 'Developer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Fredrik is a fullstack developer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stockholm, Sweden' | ||
}], | ||
learningTeam: [{ | ||
name: 'Sunniva Grande', | ||
role: 'Designer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Sunniva is a UX designer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stavanger, Norway' | ||
}, { | ||
name: 'Sunniva Grande', | ||
role: 'Designer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Sunniva is a UX designer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stavanger, Norway' | ||
},{ | ||
name: 'Sunniva Grande', | ||
role: 'Designer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Sunniva is a UX designer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stavanger, Norway' | ||
},{ | ||
name: 'Sunniva Grande', | ||
role: 'Designer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Sunniva is a UX designer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stavanger, Norway' | ||
},{ | ||
name: 'Sunniva Grande', | ||
role: 'Designer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Sunniva is a UX designer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stavanger, Norway' | ||
},{ | ||
name: 'Sunniva Grande', | ||
role: 'Designer', | ||
githubUrl: 'https://github.com/fredrik-lundin', | ||
avatar: 'https://github.com/fredrik-lundin.png', | ||
twitterUrl: 'https://twitter.com/kirderflundin', | ||
linkedin: 'https://www.linkedin.com/in/lundin-fredrik', | ||
email: 'mailto:flu.lund@gmail.com', | ||
bio: 'Sunniva is a UX designer, during most of his daily work in the ' | ||
+ '.Net space. He is born and raised in Stavanger, Norway' | ||
}] | ||
}]); | ||
} | ||
} |
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