Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/datepicker/calendar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('MdCalendar', () => {
.querySelector('.mat-calendar-period-button');

intl.switchToYearViewLabel = 'Go to year view?';
intl.changes.emit();
intl.changes.next();
fixture.detectChanges();

expect(button.getAttribute('aria-label')).toBe('Go to year view?');
Expand Down
5 changes: 3 additions & 2 deletions src/lib/datepicker/datepicker-intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {Injectable, EventEmitter} from '@angular/core';
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs/Subject';


/** Datepicker data that requires internationalization. */
Expand All @@ -16,7 +17,7 @@ export class MdDatepickerIntl {
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
changes: EventEmitter<void> = new EventEmitter<void>();
changes: Subject<void> = new Subject<void>();

/** A label for the calendar popup (used by screen readers). */
calendarLabel = 'Calendar';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/datepicker/datepicker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ describe('MdDatepicker', () => {
const toggle = fixture.debugElement.query(By.css('button')).nativeElement;

intl.openCalendarLabel = 'Open the calendar, perhaps?';
intl.changes.emit();
intl.changes.next();
fixture.detectChanges();

expect(toggle.getAttribute('aria-label')).toBe('Open the calendar, perhaps?');
Expand Down
5 changes: 3 additions & 2 deletions src/lib/paginator/paginator-intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {Injectable, EventEmitter} from '@angular/core';
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs/Subject';

/**
* To modify the labels and text displayed, create a new instance of MdPaginatorIntl and
Expand All @@ -18,7 +19,7 @@ export class MdPaginatorIntl {
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
changes: EventEmitter<void> = new EventEmitter<void>();
changes: Subject<void> = new Subject<void>();

/** A label for the page size selector. */
itemsPerPageLabel = 'Items per page:';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/paginator/paginator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('MdPaginator', () => {
const label = fixture.nativeElement.querySelector('.mat-paginator-page-size-label');

intl.itemsPerPageLabel = '1337 items per page';
intl.changes.emit();
intl.changes.next();
fixture.detectChanges();

expect(label.textContent).toBe('1337 items per page');
Expand Down
5 changes: 3 additions & 2 deletions src/lib/sort/sort-header-intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {Injectable, EventEmitter} from '@angular/core';
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs/Subject';
import {SortDirection} from './sort-direction';

/**
Expand All @@ -19,7 +20,7 @@ export class MdSortHeaderIntl {
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
changes: EventEmitter<void> = new EventEmitter<void>();
changes: Subject<void> = new Subject<void>();

/** ARIA label for the sorting button. */
sortButtonLabel = (id: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sort/sort.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('MdSort', () => {
const button = header.querySelector('.mat-sort-header-button');

intl.sortButtonLabel = () => 'Sort all of the things';
intl.changes.emit();
intl.changes.next();
fixture.detectChanges();

expect(button.getAttribute('aria-label')).toBe('Sort all of the things');
Expand Down