Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResponsiveBreakpointService #112

Open
Jogo27 opened this issue Jun 10, 2021 · 0 comments
Open

ResponsiveBreakpointService #112

Jogo27 opened this issue Jun 10, 2021 · 0 comments
Assignees
Labels
Angular Front end
Projects

Comments

@Jogo27
Copy link
Member

Jogo27 commented Jun 10, 2021

This ticket is part of the information panel subproject. The goal of this ticket is to implement a service that informs components when the responsive breakpoints defined in the stylesheats are reached. This service will later be used by PollComponent and CreateComponent to decide whether the informations must be in an InformationPanelComponent.
I suggest the following steps:

  • Create the service by launching ng generate service ResponsiveBreakpoint.
  • Choose a type to hold the information provided by the service. This information says in which width range the page is currently displayed. For instance, you could use a TypeScript enum, or a union of string literal types.
  • The information will be provided to the component by a read-only property of type Observable. This read-only property is backed by a private variable of type BehaviorSubject. Look for instance in app/src/app/config.service.ts to have an example of such a pair of properties.
  • To update the private variable (using the next method), you could use a BreakpointObserver provided by Angular Material. The width limits to observe are read from CSS, as in the prototype.
  • Test your work by injecting the ResponsiveBreakpointService into PollComponent, and displaying the information it provides using the async pipe.
  • Once everything works fine, you could optimize your code by removing the private variable backing the observable property, and use filter, map and/or others RxJS operators directly on the returned value of the observe method of BreakpointObserver.
@Jogo27 Jogo27 added the Angular Front end label Jun 10, 2021
@Jogo27 Jogo27 added this to Backlog in Projet tuteuré Itero via automation Jun 10, 2021
@Jogo27 Jogo27 self-assigned this Jul 5, 2021
@Jogo27 Jogo27 removed this from Backlog in Projet tuteuré Itero Jul 5, 2021
@Jogo27 Jogo27 added this to Warm in Itero via automation Jul 5, 2021
@Jogo27 Jogo27 moved this from Warm to Hot in Itero Jul 5, 2021
@Jogo27 Jogo27 moved this from Hot to In progress in Itero Jul 5, 2021
Jogo27 added a commit that referenced this issue Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Angular Front end
Projects
Itero
In progress
Development

No branches or pull requests

1 participant