我发现我好像变了,原来每当人成长的时候都会改变。生命本该有意义,我们绝不是白来一场。
如下所示:
$rootScope.$watch('title',function(title){
var body = document.getElementsByTagName('body')[0];
document.title = title;
var iframe = document.createElement("iframe");
iframe.title = "';
iframe.width = 0;
iframe.height = 0;
iframe.setAttribute("src", "/empty.png");
iframe.addEventListener('load', function() {
setTimeout(function() {
iframe.removeEventListener('load');
document.body.removeChild(iframe);
}, 0);
});
document.body.appendChild(iframe);
});
// 代码放在app.js中,代码备份下,预防下次遇到同样的问题。
以上这篇ios设备中angularjs无法改变页面title的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。