You need to use the Full Screen API
, which is provided by almost all browsers. You can read about it here.
In short, to display an Element
in full-screen mode, you need to call requestFullscreen()
on it. Exiting it is done via exitFullscreen()
. To check if a browser is in full-screen mode, you can access the fullscreenElement
document property. You can also handle the fullscreenchange
event to be notified when full-screen mode is toggled.
Since this API has compatibility issues with Webkit-based browsers, I would suggest that you use the webkit
prefix.
If you want to implement the full-screen feature in an 'Angular way,' I would suggest creating a directive. You can use a third-party library if you prefer, such as the ngx-fullscreen-directive.