Skip to content

Commit b6ec722

Browse files
committed
remove old hack; reformat files
1 parent 7ac7ebd commit b6ec722

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/components-examples/material/table/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ng_module(
1111
]),
1212
module_name = "@angular/components-examples/material/table",
1313
deps = [
14+
"//src/cdk/drag-drop",
15+
"//src/cdk/table",
1416
"//src/material/button",
1517
"//src/material/button-toggle",
1618
"//src/material/checkbox",
@@ -20,8 +22,6 @@ ng_module(
2022
"//src/material/progress-spinner",
2123
"//src/material/sort",
2224
"//src/material/table",
23-
"//src/cdk/table",
24-
"//src/cdk/drag-drop",
2525
],
2626
)
2727

src/components-examples/material/table/table-reorderable/table-reorderable-example.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,11 @@ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
1010
styleUrls: [ './table-reorderable-example.css' ]
1111
})
1212
export class TableReorderableExample {
13-
private _originalColumnPositions: string[] = ['position', 'name', 'weight', 'symbol'];
14-
columns: string[] = this._originalColumnPositions.slice();
13+
columns: string[] = ['position', 'name', 'weight', 'symbol'];
1514
dataSource = ELEMENT_DATA;
1615

1716
drop(event: CdkDragDrop<string[]>) {
18-
moveItemInArray(this.columns, this.getCurPosition(event.previousIndex), event.currentIndex);
19-
}
20-
21-
getCurPosition(colOldIndex: number): number {
22-
const colName: string = this._originalColumnPositions[colOldIndex];
23-
const p = (e: string) => e == colName;
24-
return this.columns.findIndex(e => e == colName);
17+
moveItemInArray(this.columns, event.previousIndex, event.currentIndex);
2518
}
2619
}
2720

0 commit comments

Comments
 (0)