diff --git a/src/demo-app/table/person-data-source.ts b/src/demo-app/table/person-data-source.ts index 9837486dcda..6bf96511be1 100644 --- a/src/demo-app/table/person-data-source.ts +++ b/src/demo-app/table/person-data-source.ts @@ -15,7 +15,7 @@ export class PersonDataSource extends DataSource { connect(): Observable { const displayDataChanges = [ this._paginator.page, - this._sort.mdSortChange, + this._sort.sortChange, this._peopleDatabase.dataChange ]; return Observable.merge(...displayDataChanges).map(() => { diff --git a/src/lib/sort/sort-header.ts b/src/lib/sort/sort-header.ts index fd78373b18c..bdd4ccaec01 100644 --- a/src/lib/sort/sort-header.ts +++ b/src/lib/sort/sort-header.ts @@ -91,7 +91,7 @@ export class MdSortHeader implements MdSortable { throw getMdSortHeaderNotContainedWithinMdSortError(); } - this._rerenderSubscription = merge(_sort.mdSortChange, _intl.changes).subscribe(() => { + this._rerenderSubscription = merge(_sort.sortChange, _intl.changes).subscribe(() => { changeDetectorRef.markForCheck(); }); } diff --git a/src/lib/sort/sort.spec.ts b/src/lib/sort/sort.spec.ts index 57ff5f34708..d4a5d40b53b 100644 --- a/src/lib/sort/sort.spec.ts +++ b/src/lib/sort/sort.spec.ts @@ -200,10 +200,10 @@ function testSingleColumnSortDirectionSequence(fixture: ComponentFixture -
A
-
B
-
D
-
E
+
A
+
B
+
D
+
E
` }) diff --git a/src/lib/sort/sort.ts b/src/lib/sort/sort.ts index ec30d607b24..c0151361bfe 100644 --- a/src/lib/sort/sort.ts +++ b/src/lib/sort/sort.ts @@ -72,7 +72,10 @@ export class MdSort { set _matSortDisableClear(v) { this.disableClear = v; } /** Event emitted when the user changes either the active sort or sort direction. */ - @Output() mdSortChange = new EventEmitter(); + @Output('mdSortChange') readonly sortChange = new EventEmitter(); + + @Output('matSortChange') + get _matSortChange(): EventEmitter { return this.sortChange; } /** * Register function to be used by the contained MdSortables. Adds the MdSortable to the @@ -106,7 +109,7 @@ export class MdSort { this.direction = this.getNextSortDirection(sortable); } - this.mdSortChange.next({active: this.active, direction: this.direction}); + this.sortChange.next({active: this.active, direction: this.direction}); } /** Returns the next sort direction of the active sortable, checking for potential overrides. */ diff --git a/src/material-examples/table-http/table-http-example.ts b/src/material-examples/table-http/table-http-example.ts index 60c10fa515b..bd3fac7c6ba 100644 --- a/src/material-examples/table-http/table-http-example.ts +++ b/src/material-examples/table-http/table-http-example.ts @@ -83,12 +83,12 @@ export class ExampleDataSource extends DataSource { /** Connect function called by the table to retrieve one stream containing the data to render. */ connect(): Observable { const displayDataChanges = [ - this.sort.mdSortChange, + this.sort.sortChange, this.paginator.page ]; // If the user changes the sort order, reset back to the first page. - this.sort.mdSortChange.subscribe(() => this.paginator.pageIndex = 0); + this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); return Observable.merge(...displayDataChanges) .startWith(null) diff --git a/src/material-examples/table-overview/table-overview-example.ts b/src/material-examples/table-overview/table-overview-example.ts index b564dd30488..2fd7d0883e4 100644 --- a/src/material-examples/table-overview/table-overview-example.ts +++ b/src/material-examples/table-overview/table-overview-example.ts @@ -140,7 +140,7 @@ export class ExampleDataSource extends DataSource { // Listen for any changes in the base data, sorting, filtering, or pagination const displayDataChanges = [ this._exampleDatabase.dataChange, - this._sort.mdSortChange, + this._sort.sortChange, this._filterChange, this._paginator.page, ]; diff --git a/src/material-examples/table-sorting/table-sorting-example.ts b/src/material-examples/table-sorting/table-sorting-example.ts index 1cbcc4c6f68..36df176410c 100644 --- a/src/material-examples/table-sorting/table-sorting-example.ts +++ b/src/material-examples/table-sorting/table-sorting-example.ts @@ -90,7 +90,7 @@ export class ExampleDataSource extends DataSource { connect(): Observable { const displayDataChanges = [ this._exampleDatabase.dataChange, - this._sort.mdSortChange, + this._sort.sortChange, ]; return Observable.merge(...displayDataChanges).map(() => {