Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #30 from DSchau/development
Browse files Browse the repository at this point in the history
add in duration for remaining slides; fix errors in slide deck
  • Loading branch information
DSchau authored Apr 27, 2017
2 parents 65b9785 + 9c6c7f3 commit 797a7e7
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 73 deletions.
4 changes: 2 additions & 2 deletions src/slides/06-model-driven-forms/01.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Model Driven Forms

<aside class="notes">
Duration:
Lab Duration:
Duration: 15:00
Lab Duration: 45:00
</aside>
6 changes: 3 additions & 3 deletions src/slides/07-pipes/01.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pipes

<aside class="notes">
Duration:
Lab Duration:
<aside class="notes" data-markdown>
Duration: 10:00
Lab Duration: 20:00
</aside>
2 changes: 1 addition & 1 deletion src/slides/07-pipes/05.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```typescript
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({name: 'people-years'})
@Pipe({name: 'peopleYears'})
export class PeopleYearsPipe implements PipeTransform {
transform(age: number): number {
return age * 7;
Expand Down
2 changes: 1 addition & 1 deletion src/slides/07-pipes/07.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Template
</md-list-item>
<md-list-item *ngFor="let dog of dogs">
<h3 md-line>{{dog.name}}</h3>
<p md-line>{{dog.age | people-years}} old {{dog.breed}}</p>
<p md-line>{{dog.age | peopleYears}} old {{dog.breed}}</p>
</md-list-item>
</md-list>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/slides/07-pipes/08.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

- Create a custom pipe for the timesheet list component
- Takes as input the timesheet
- Outputs the current status of a timsheet as pending, active, or complete.
- Outputs the current status of a timesheet as pending, active, or complete.
3 changes: 2 additions & 1 deletion src/slides/08-structural-directives/01.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Structural Directives

<aside class="notes">
Duration:
Duration: 15:00
Workshop: 20:00
</aside>
2 changes: 2 additions & 0 deletions src/slides/09-attribute-directives/02.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
## Example

Let's build a directive that applies some styles for an "old dog"
46 changes: 44 additions & 2 deletions src/slides/09-attribute-directives/03.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
## Example
## `appDogAge`

Let's build a directive that applies some styles for an "old dog"
```typescript
import { Directive, ElementRef, Input } from '@angular/core';

@Directive({ selector: '[appDogAge]' })
export class DogAgeDirective {
private existingStyle: any;

@Input()
set appDogAge(age: number) {
if ( age >= 14 ) {
this.setStyle();
} else {
this.removeStyle();
}
}

@Input()
oldAge: number = 14;

constructor(private el: ElementRef) {}

private setStyle(): void {
if ( !this.existingStyle ) {
this.existingStyle = {
color: this.el.nativeElement.style.color,
textDecoration: this.el.nativeElement.style.textDecoration
};

this.el.nativeElement.style.color = '#AAAAAA';
this.el.nativeElement.style.textDecoration = 'strikthrough';
}
}

private removeStyle(): void {
if ( this.existingStyle ) {
Object.keys(this.existingStyle)
.forEach((key: string) => {
this.el.nativeElement.style[key] = this.existingStyle[key];
});
}
}
}
```
49 changes: 8 additions & 41 deletions src/slides/09-attribute-directives/04.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,12 @@
## `appDogAge`
## Lab 7

```typescript
import { Directive, ElementRef, Input } from '@angular/core';

@Directive({ selector: ['appDogAge'] })
export class DogAgeDirective {
private existingStyle: any;

@Input()
set appDogAge(age: number) {
if ( age >= 14 ) {
this.setStyle();
} else {
this.removeStyle();
}
}

@Input()
oldAge: number = 14;
- Create an `[atEmployee]` directive in `src/app/employee/employee-list/employee.directive.ts`
- This directive should take an `Employee` instance and output to the component's innerHTML the employee's name and whether an admin or not
- Note: `ElementRef` from `@angular/core` is helpful, as is the following snippet

constructor(private el: ElementRef) {}

private setStyle(): void {
if ( !this.existingStyle ) {
this.existingStyle = {
color: this.el.nativeElement.style.color,
textDecoration: this.el.nativeElement.style.textDecoration
};

this.el.nativeElement.style.color = '#AAAAAA';
this.el.nativeElement.style.textDecoration = 'strikthrough';
}
}

private removeStyle(): void {
if ( this.existingStyle ) {
Object.keys(this.existingStyle)
.forEach((key: string) => {
this.el.nativeElement.style[key] = this.existingStyle[key];
});
}
}
```typescript
@Input()
set someValue() {
// this is called each time someValue is updated
}
```
12 changes: 0 additions & 12 deletions src/slides/09-attribute-directives/05.md

This file was deleted.

4 changes: 2 additions & 2 deletions src/slides/10-module-based-routing/01.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Module Based Routing

<aside class="notes">
Duration:
Lab Duration:
Duration: 25:00
Lab Duration: 0:00
</aside>
4 changes: 2 additions & 2 deletions src/slides/11-testing/01.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Testing

<aside class="notes">
Duration:
Lab Duration:
Duration: 30:00
Lab Duration: 30:00
</aside>
2 changes: 1 addition & 1 deletion src/slides/12-application-perf/01.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Application Performance

<aside class="notes">
Duration:
Duration: 20:00
</aside>
3 changes: 1 addition & 2 deletions src/slides/13-upgrade-component/01.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Upgrade Component

<aside class="notes">
Duration:
Lab Duration:
Duration: 10:00
</aside>
3 changes: 1 addition & 2 deletions src/slides/14-upgrade-app/01.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Upgrade Application

<aside class="notes">
Duration:
Lab Duration:
Duration: 10:00
</aside>

0 comments on commit 797a7e7

Please sign in to comment.