Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 处于fullScren模式的网页_Angular - Fatal编程技术网

Angular 处于fullScren模式的网页

Angular 处于fullScren模式的网页,angular,Angular,如何使用angular或vanilla js在全屏模式下自动触发web页面 我使用javascript api将我的web应用程序触发到全屏模式,但此api不允许在全屏模式下触发它您可以使用screenfull模块 全屏显示页面 document.getElementById('button').addEventListener('click', () => { if (screenfull.isEnabled) { screenfull.request();

如何使用angular或vanilla js在全屏模式下自动触发web页面


我使用javascript api将我的web应用程序触发到全屏模式,但此api不允许在全屏模式下触发它

您可以使用screenfull模块

全屏显示页面

document.getElementById('button').addEventListener('click', () => {
    if (screenfull.isEnabled) {
        screenfull.request();
    } else {
        // Ignore or do something else
    }
});

我确实在Angular应用程序中使用。请共享一些您已经编写的代码。@snsakib我正在使用screenfull js库来触发fulScreen模式,以下是我的组件ngOnInit()中的代码:void{if(screnfull.isEnabled){screnfull.toggle().catch(()=>{}。使用此解决方案,我们必须单击按钮。在我的情况下,我不想自动触发全屏模式,无需任何用户交互或手势。您可以将代码放入ngOnInit,当组件加载时,它将自动全屏显示