如何在API点击时检查Angular2中的互联网连接,每当我的应用程序API被命中服务器时,有时用户离线(我的意思是没有互联网连接)所以我如何检查互联网连接?是否有一些特殊的互联网连接状态代码?或者是其他东西 ?
PS: - 我navigator.onLine在angularJs中发现但似乎没有在angular2中工作.
正如sudheer在下面的回答中建议navigator.onLine使用angular2但仍然无法正常工作原因?
working example here
我需要一个JavaScript,它在屏幕中央显示隐藏的div作为模态,带有像jquery对话框一样的深色背景!
例:
<div id='divToShow' style='display:none'>
Here is the content of the div that should be shown as modal on the center of the page!
</div>
Run Code Online (Sandbox Code Playgroud)
谁可以帮忙?谢谢