在Angular的index.html里插入script,拦截所有动态创建标签页的场景
2023-09-14 09:04:03 时间
注意,下面这段代码只能插入在Angular应用的index.html里,直接插入任何Component的index.html里不会生效:
<script>
console.log("Jerry");
debugger;
var scripts = document.querySelectorAll("script");
var old = document.createElement;
var _this = window.document;
document.createElement = function(input){
console.log("trying to create new tag: " + input);
return old.call(_this, input);
}
debugger;
</script>
相关文章
- 【响应式编程的思维艺术】 (5)Angular中Rxjs的应用示例
- [Angular 9] Built-in template syntax $any
- [Angular] Debug Angular apps in production without revealing source maps
- [Angular Unit Testing] Debug unit testing -- component rendering
- [Angular2 Form] Create and Submit an Angular 2 Form using ngForm
- [Angular-Scaled Web] 8. Using $http to load JSON data
- [Angular-Scaled web] 2. Architecture sub-modules
- [Angular] Using the Argon 2 Hashing Function In Our Sign Up Backend Service
- [Angular HTML] Overwrite input value, String.fromCharCode & input.selectionStart
- [Angular] Test Directive
- [Angular 2] Property Binding
- [Angular 2] Using ng-model for two-way binding
- [Unit Testing] Angular Unit Testing, ui-router, httpbackend and spy
- 关于 Angular 部署以及 index.html 里 base hRef 属性的关联关系
- 从编译后的代码,分析 Angular @Injectable 的工作原理
- Angular Lazy load学习笔记
- 每个施加在HTML元素上的Angular Directive,运行时都会生成一个新的实例
- Angular NgModule里定义的注解和NgModuleRef$1运行时
- Angular应用从Component到Html的数据绑定是如何实现的 -数据流的讨论