虚位以待(AD)
虚位以待(AD)
首页 > 网页特效 > Jquery > angular.JS实现网页禁用调试、复制和剪切

angular.JS实现网页禁用调试、复制和剪切
类别:Jquery   作者:码皇   来源:互联网   点击:

这篇文章主要给大家介绍了angular JS实现网页禁用调试、复制和剪切的相关资料,文中介绍的非常详细,相信对大家具有一定的参考价值,需要的朋友们下面来一起看看吧。

一、angular根据环境配置禁用调试:

    // Disable debug data for production environment// @link https://docs.angularjs.org/guide/production$compileProvider.debugInfoEnabled( app.applicationEnvironment !== 'production');
    $logProvider.debugEnabled( app.applicationEnvironment !== 'production');

上面就是根据当前的环境是不是生产环境,来禁用调试了。

二、然后angular单页web如果要禁用复制和剪切

其实实现也很简单,动态添加事件注册,在angular的模块bootstrap的时候注册就好:

    // Then init the appangular.bootstrap(document, [app.applicationModuleName]);
    // Disable the copy and cutdocument.oncopy = function () {
    return false;
    }
    ;
    document.oncut = function () {
    return false;
    }
    ;

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对脚本之家的支持。

相关热词搜索: angularjs 禁用属性 angularjs 调试 angul