Thursday, 4 July 2019

Angular CDK Layout - How to include BreakPointObserver globally across the project

I am setting up a new project with latest Angular.I am using Angular Material for this.I am using BreakpointObserver from @angular/cdk/layout. I am able to add that succesfully to one of my component.But I want to add it globally to my project so that all the components/modules can use web/tablet/mobile breakpoints for different DOM manipulation.

I am able to add that to the app.component.ts , but I am expecting to write a directive or something.Not service because BreakpointObserver is already a service.

What would be the best approach to add BreakPointObserver observables globally in the project.Do not want to add isHandset$ observables everytime in each component's ts file



from Angular CDK Layout - How to include BreakPointObserver globally across the project

No comments:

Post a Comment