-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
designThis issue needs design work before implementingThis issue needs design work before implementingfeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fix
Description
We should have something that works both in headless rendering and browsers.
The solution should be something along those lines (pseudo code):
@Injectable()
export class MdLayoutService {
onLayoutChange: EventEmitter<MdLayoutEnum> = new EventEmitter<MdLayoutEnum>();
get currentLayout(): MdLayoutEnum {
return this.layout_;
}
constructor(private layout_: MdLayoutEnum) {
if (!headless) { // <-- Tricky part
window.matchMedia('...').addListener((mql) => this.onLayoutChange.emit(...));
}
}
};
You can then provide an MdLayoutEnum
constant in headless browsing (or if you want to fix it in the browser or unit tests).
TODO:
- Design Doc.
Wlada, cleever, andcea, pramttl, eserlan and 6 more
Metadata
Metadata
Assignees
Labels
designThis issue needs design work before implementingThis issue needs design work before implementingfeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fix