如下所示:

$rootScope.$watch(' ',function( ){
 var body = document.getElementsByTagName('body')[0];
 document.  =  ;
 var   = document.createElement(" ");
  .  = '';
  .width = 0;
  .height = 0;
  .setAttribute("src", "/empty.png");

  .addEventListener('load', function() {
 setTimeout(function() {
   .removeEventListener('load');
  document.body.removeChild( );
 }, 0);
 });
 document.body.appendChild( );
});

// 代码放在app.js中,代码备份下,预防下次遇到同样的问题。

以上这篇ios设备中angularjs无法改变页面 的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

收藏 打印