Angular2-多次调用ngAfterViewChecked ..如何在DOM完全加载后立即调用一个方法? [英] Angular2 -- ngAfterViewChecked is called many times..How to call a method just once after DOM is completely loaded?

查看:305
本文介绍了Angular2-多次调用ngAfterViewChecked ..如何在DOM完全加载后立即调用一个方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Typescriptjquery插件应用于Angular2中的单选按钮.

I need to apply jquery plugin to radio buttons in Angular2 using Typescript.

如果我在ngAfterViewChecked中进行分配,则会调用多次,并且控件会刷新多次.

If I assign in ngAfterViewChecked, it is called many times and the control is refreshed multiple times.

在DOM准备就绪后调用javascript方法的替代解决方案是什么?

What is the alternate solution for calling the javascript method after DOM is ready?

推荐答案

尝试ngAfterViewInit并查看 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆