Skip to content

Commit 7ac8870

Browse files
committed
Add github code links to the examples
1 parent 528db0b commit 7ac8870

24 files changed

+105
-38
lines changed

packages/examples/src/app/app.component.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<div *ngIf="true">
22
<ul>
3-
<li class="root"></li>
4-
<li><a [routerLink]="['sortable']">Sortable</a></li>
5-
<li><a [routerLink]="['chessboard']">Chessboard (tutorial)</a></li>
6-
<li><a [routerLink]="['drilldown']">Drilldown</a></li>
3+
<li><b>Applications</b>
4+
<ul>
5+
<li><a [routerLink]="['chessboard']">Chessboard (tutorial)</a></li>
6+
<li><a [routerLink]="['sortable']">Basic Sortable</a></li>
7+
<li><a [routerLink]="['drilldown']">Drilldown</a></li>
8+
<li><a [routerLink]="['bins']">Mail sorting</a></li>
9+
</ul>
710
<li><b>Nesting</b>
811
<ul>
912
<li><a [routerLink]="['nested', 'sources']">Nested sources</a></li>
@@ -15,8 +18,10 @@
1518
<li><a [routerLink]="['drag-layer', 'xy-pad']">XY Pad</a></li>
1619
</ul></li>
1720
<!-- <li><a [routerLink]="['touch']">Touch backend</a></li> -->
18-
<li><a [routerLink]="['customize', 'handles-previews']">Customize handles and previews with HTML5</a></li>
19-
<li><a [routerLink]="['bins']">Mail sorting with touch support</a></li>
21+
<li><b>Customize</b></li>
22+
<ul>
23+
<li><a [routerLink]="['customize', 'handles-previews']">handles and previews</a></li>
24+
</ul>
2025
</ul>
2126
</div>
2227

packages/examples/src/app/app.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { DragDropManager } from 'dnd-core';
2525
import { PreloadAllModules } from '@angular/router';
2626
// this is our own adaptation of dnd-multi-backend. will be published eventually
2727
import { createDefaultMultiBackend } from './angular-skyhook-multi-backend';
28+
import { ExampleLink } from './example-link.component';
29+
import { UtilityModule } from './utility.module';
2830

2931
let routes: Routes = [
3032
{ path: '', pathMatch: 'full', redirectTo: 'bins' },
@@ -47,6 +49,7 @@ let routes: Routes = [
4749
imports: [
4850
BrowserModule,
4951
BrowserAnimationsModule,
52+
UtilityModule,
5053
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules, useHash: true }),
5154
SkyhookDndModule.forRoot({ backendFactory: createDefaultMultiBackend }),
5255
// SkyhookDndModule.forRoot({ backend: TouchBackend }),

packages/examples/src/app/bins/container.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Component } from "@angular/core";
22

33
@Component({
44
template: `
5+
<app-example-link path="bins"></app-example-link>
6+
57
<skyhook-preview>
68
<ng-template let-type let-item="item">
79
<app-trash [type]="type" [inFlight]="true">

packages/examples/src/app/bins/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { CommonModule } from '@angular/common';
88
import { RouterModule } from '@angular/router';
99
import { SkyhookDndModule } from 'angular-skyhook';
1010
import { MultiBackendPreviewModule } from '../angular-skyhook-multi-backend';
11+
import { UtilityModule } from '../utility.module';
1112

1213
@NgModule({
1314
declarations: [
@@ -18,6 +19,7 @@ import { MultiBackendPreviewModule } from '../angular-skyhook-multi-backend';
1819
SkyhookDndModule,
1920
RouterModule.forChild([{ path: '', component: Container }]),
2021
MultiBackendPreviewModule,
22+
UtilityModule
2123
],
2224
})
2325
export class Module { }

packages/examples/src/app/chessboard/container.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Component } from '@angular/core';
33
@Component({
44
selector: 'app-chess-container',
55
template: `
6+
<app-example-link path="chessboard"></app-example-link>
67
<div class="container">
78
<app-board></app-board>
89
</div>

packages/examples/src/app/chessboard/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { CommonModule } from '@angular/common';
99
import { RouterModule } from '@angular/router';
1010
import { SkyhookDndModule } from 'angular-skyhook';
1111
import { GameService } from './game.service';
12+
import { UtilityModule } from 'app/utility.module';
1213

1314
@NgModule({
1415
declarations: [
@@ -17,7 +18,8 @@ import { GameService } from './game.service';
1718
imports: [
1819
CommonModule,
1920
SkyhookDndModule,
20-
RouterModule.forChild([{ path: '', component: ContainerComponent }])
21+
RouterModule.forChild([{ path: '', component: ContainerComponent }]),
22+
UtilityModule,
2123
],
2224
providers: [
2325
GameService

packages/examples/src/app/customize/handles-previews/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import { NgModule } from '@angular/core';
66
import { CommonModule } from '@angular/common';
77
import { RouterModule } from '@angular/router';
88
import { SkyhookDndModule } from 'angular-skyhook';
9+
import { UtilityModule } from '../../utility.module';
910
@NgModule({
1011
declarations: [
1112
CustomPreview, Handle, Container
1213
],
1314
imports: [
1415
CommonModule,
1516
SkyhookDndModule,
16-
RouterModule.forChild([{ path: '', component: Container }])
17+
RouterModule.forChild([{ path: '', component: Container }]),
18+
UtilityModule
1719
],
1820
})
1921
export class HandlesPreviewsModule { }

packages/examples/src/app/drag-layer/container.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Component } from '@angular/core';
33
@Component({
44
selector: 'app-drag-layer-container',
55
template: `
6+
<app-example-link path="customize/handles-previews"></app-example-link>
67
<app-custom-drag-layer></app-custom-drag-layer>
78
<app-drag-container></app-drag-container>
89
`

packages/examples/src/app/drag-layer/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { DragContainerComponent } from './drag-container/drag-container.componen
88
import { BoxDragPreviewComponent } from './box-drag-preview/box-drag-preview.component';
99
import { ContainerComponent } from './container.component';
1010
import { BoxComponent } from './box.component';
11+
import { UtilityModule } from '../utility.module';
1112

1213
@NgModule({
1314
declarations: [
@@ -21,7 +22,8 @@ import { BoxComponent } from './box.component';
2122
imports: [
2223
CommonModule,
2324
SkyhookDndModule,
24-
RouterModule.forChild([{ path: '', component: ContainerComponent }])
25+
RouterModule.forChild([{ path: '', component: ContainerComponent }]),
26+
UtilityModule
2527
],
2628
})
2729
export class Module { }

packages/examples/src/app/drilldown/container.component.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@ import { TreeService } from './tree.service';
44
@Component({
55
selector: 'drilldown-container',
66
template: `
7-
<div>
8-
<drilldown-folder [keys]="[]"></drilldown-folder>
9-
</div>
10-
7+
<app-example-link path="drilldown"></app-example-link>
8+
<p>Hover over a folder to temporarily drill down. Click normally on a folder to open or close it.</p>
9+
<p *ngIf="lastDrop$|async as keys">Last dropped on <code> {{keys.join(' > ')}} </code></p>
1110
<drilldown-source (beginDrag)="beginDrag()" (endDrag)="endDrag()"></drilldown-source>
12-
13-
<div *ngIf="lastDrop$|async as keys">
14-
<p>Last dropped on <code> {{keys.join(' > ')}} </code></p>
15-
</div>
11+
<drilldown-folder [keys]="[]"></drilldown-folder>
1612
`,
1713
styles: [`
1814
`]

0 commit comments

Comments
 (0)