Skip to content

Commit a41578c

Browse files
committed
scafold play nested components
1 parent eb3d431 commit a41578c

17 files changed

+152
-4
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
connector works!
3+
</p>

app/angular2/src/app/play/connector/connector.component.less

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* tslint:disable:no-unused-variable */
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { By } from '@angular/platform-browser';
4+
import { DebugElement } from '@angular/core';
5+
6+
import { ConnectorComponent } from './connector.component';
7+
8+
describe('ConnectorComponent', () => {
9+
let component: ConnectorComponent;
10+
let fixture: ComponentFixture<ConnectorComponent>;
11+
12+
beforeEach(async(() => {
13+
TestBed.configureTestingModule({
14+
declarations: [ ConnectorComponent ]
15+
})
16+
.compileComponents();
17+
}));
18+
19+
beforeEach(() => {
20+
fixture = TestBed.createComponent(ConnectorComponent);
21+
component = fixture.componentInstance;
22+
fixture.detectChanges();
23+
});
24+
25+
it('should create', () => {
26+
expect(component).toBeTruthy();
27+
});
28+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import Connector from './Connector';
3+
4+
@Component({
5+
selector: 'app-connector',
6+
templateUrl: './connector.component.html',
7+
styleUrls: ['./connector.component.less']
8+
})
9+
export class ConnectorComponent implements OnInit {
10+
11+
constructor() { }
12+
13+
ngOnInit() {
14+
}
15+
16+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
junction works!
3+
</p>

app/angular2/src/app/play/junction/junction.component.less

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* tslint:disable:no-unused-variable */
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { By } from '@angular/platform-browser';
4+
import { DebugElement } from '@angular/core';
5+
6+
import { JunctionComponent } from './junction.component';
7+
8+
describe('JunctionComponent', () => {
9+
let component: JunctionComponent;
10+
let fixture: ComponentFixture<JunctionComponent>;
11+
12+
beforeEach(async(() => {
13+
TestBed.configureTestingModule({
14+
declarations: [ JunctionComponent ]
15+
})
16+
.compileComponents();
17+
}));
18+
19+
beforeEach(() => {
20+
fixture = TestBed.createComponent(JunctionComponent);
21+
component = fixture.componentInstance;
22+
fixture.detectChanges();
23+
});
24+
25+
it('should create', () => {
26+
expect(component).toBeTruthy();
27+
});
28+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import Junction from './Junction';
3+
4+
@Component({
5+
selector: 'app-junction',
6+
templateUrl: './junction.component.html',
7+
styleUrls: ['./junction.component.less']
8+
})
9+
export class JunctionComponent implements OnInit {
10+
11+
constructor() { }
12+
13+
ngOnInit() {
14+
}
15+
16+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<div id="board">
22

33
<div id="overlay-message"></div>
4+
5+
<app-puck [x]="y"></app-puck>
46

57
</div>

app/angular2/src/app/play/play.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import { Component, OnInit } from '@angular/core';
2-
import Junction from './Junction';
3-
import Connector from './Connector';
4-
import Puck from './Puck';
52

63
@Component({
74
selector: 'app-play',
@@ -13,8 +10,10 @@ import Puck from './Puck';
1310
*/
1411
export class PlayComponent implements OnInit {
1512

13+
y: number;
14+
1615
constructor() {
17-
16+
this.y = 2;
1817
}
1918

2019
ngOnInit() {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
puck works!
3+
</p>

app/angular2/src/app/play/puck/puck.component.less

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* tslint:disable:no-unused-variable */
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { By } from '@angular/platform-browser';
4+
import { DebugElement } from '@angular/core';
5+
6+
import { PuckComponent } from './puck.component';
7+
8+
describe('PuckComponent', () => {
9+
let component: PuckComponent;
10+
let fixture: ComponentFixture<PuckComponent>;
11+
12+
beforeEach(async(() => {
13+
TestBed.configureTestingModule({
14+
declarations: [ PuckComponent ]
15+
})
16+
.compileComponents();
17+
}));
18+
19+
beforeEach(() => {
20+
fixture = TestBed.createComponent(PuckComponent);
21+
component = fixture.componentInstance;
22+
fixture.detectChanges();
23+
});
24+
25+
it('should create', () => {
26+
expect(component).toBeTruthy();
27+
});
28+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Component, OnInit, Input } from '@angular/core';
2+
import Puck from './Puck';
3+
4+
@Component({
5+
selector: 'app-puck',
6+
templateUrl: './puck.component.html',
7+
styleUrls: ['./puck.component.less']
8+
})
9+
export class PuckComponent implements OnInit {
10+
11+
@Input() x: number;
12+
@Input() y: number;
13+
14+
constructor() {
15+
16+
}
17+
18+
ngOnInit() {
19+
20+
}
21+
22+
}

0 commit comments

Comments
 (0)