时间:2020-12-16 09:15:54 | 栏目:AngularJS | 点击:次
一、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 app
angular.bootstrap(document, [app.applicationModuleName]);
// Disable the copy and cut
document.oncopy = function () {
return false;
};
document.oncut = function () {
return false;
};
总结