0

I want to know is there any way that I can get the height and width information of the second monitor in Angular? right now with the window object, I can get only the height and width of one monitor in angular but I need to know the information of the second monitor as well too. the code I am using is:

@HostListener('window:resize', ['$event'])
    getScreenSize() {
          this.screenHeight = window.innerHeight;
          this.screenWidth = window.innerWidth;
          this.temp = window[0].innerWidth;
          console.log("size of monitor is");
          console.log(this.screenHeight, this.screenWidth);
    }

but in this way, I can only have the width and height for one monitor. How can I have width and height for second monitors?

rveerd
  • 3,620
  • 1
  • 14
  • 30
  • Can you attach your code to the question or create a Minimal Reproducible Example on StackBlitz? – PanterP Jun 30 '21 at 10:23
  • I'm not sure but i think `window` refers to the browser-window and not to the monitor itself. – wayneOS Jun 30 '21 at 12:08
  • You can only get information about the screen the browser is open on. See for example [Detect screen width for multiple monitors](https://stackoverflow.com/q/9407796/215552) – Heretic Monkey Jun 30 '21 at 12:54

0 Answers0