角JS NG-风格和Internet Explorer 8 [英] Angular JS ng-style and Internet Explorer 8

查看:170
本文介绍了角JS NG-风格和Internet Explorer 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎有一个问题,我无法理解。

I have a problem I can't seem to understand.

在IE8指令NG风格似乎并没有在所有的工作。我用它来设置元素的宽度。在所有其他的浏览器,它工作正常。

In IE8 the directive ng-style doesn't seem to work at all. I'm using it to set the width of an element. On all other browsers it works fine.

在IE8,用蹩脚的F12工具检查元素,样式属性是完全缺失的。

On IE8, inspecting the element with the crappy F12 tool, the style property is entirely missing.

谁能告诉我,如果有一个解决方法吗?我使用的angularjs版本是在写本新闻时的稳定版本(1.0.2)

Anyone can tell me if there's a workaround? The angularjs version I'm using is the stable version at the time of writing (1.0.2)

感谢

推荐答案

好吧,我发现为什么{{}}不是在IE7工作:你要填充工具JSON.stringify,因为它是用来显示对象和IE7不拥有它,如果你显示一个字符串,它的工作:

Ok I found why {{ }} wasn't working in IE7: you have to polyfill JSON.stringify because it's used to display objects and IE7 don't have it, if you display a string it's working:

http://jsfiddle.net/NLrYx/3/

更多信息: http://docs.angularjs.org/guide/ie

JSON脚本: https://github.com/douglascrockford/JSON -js / BLOB /主/ json2.js

这篇关于角JS NG-风格和Internet Explorer 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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