0

Is there a way to select multiple checkbox based on shift and click in Angular 2. Is there any module in angular 2? Want angular 2 solution, not jquery or JavaScript solution.

1 Answers1

0

Checkout this plunkr I altered with one way of getting the behavior you're looking for.

https://embed.plnkr.co/A8czIBHgVorKHqGRqNmk/

Basically, listen for click events, check if the shift key is held, do your checkbox logic, and then set the shiftHeld variable back to false (when a key goes up)

All of the logic is in the dashboard component and template

Pezetter
  • 2,783
  • 2
  • 22
  • 40