AngularJS 1.2.5脚本错误与文本区域和占位符属性使用IE11 [英] AngularJS v1.2.5 script error with textarea and placeholder attribute using IE11

查看:284
本文介绍了AngularJS 1.2.5脚本错误与文本区域和占位符属性使用IE11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个角JS 1.2.5形式不会在IE11工作。它在火狐,Chrome,Safari浏览器工作正常。我的表单使用一个textarea的占位符属性内插值。

I have an Angular JS v1.2.5 form that won't work in IE11. It works fine in Firefox, Chrome, Safari. My form uses a textarea with interpolation inside the placeholder attribute.

  <body ng-controller="MainCtrl">
    <p>Hello {{ name }}!</p>
    <textarea rows="4" placeholder="Description of the {{ name }}"></textarea>
  </body>

如果与插补指定占位符的属性,我得到以下错误(仅适用于IE)。

If the placeholder attribute is specified with interpolation, I get the following error (only in IE).

Error: Invalid argument.
   at interpolateFnWatchAction (https://localhost:44300/Scripts/angular.js:6410:15)
   at $digest (https://localhost:44300/Scripts/angular.js:11581:23)
   at $apply (https://localhost:44300/Scripts/angular.js:11832:13)
   at done (https://localhost:44300/Scripts/angular.js:7774:34)
   at completeRequest (https://localhost:44300/Scripts/angular.js:7947:7)
   at onreadystatechange (https://localhost:44300/Scripts/angular.js:7903:11)

下面是一个Plnkr,在火狐,Chrome,Safari浏览器工作正常 - 但不是在IE11。
<一href=\"http://plnkr.co/edit/4cJzxtVSDoL2JMI9nYrS?p=$p$pview\">http://plnkr.co/edit/4cJzxtVSDoL2JMI9nYrS?p=$p$pview

Here's a Plnkr that works fine in Firefox, Chrome, Safari - but not in IE11. http://plnkr.co/edit/4cJzxtVSDoL2JMI9nYrS?p=preview

我迷路试图在Angular.js本身进行调试。我真的AP preciate任何提示设置我正确的方向。谢谢你。

I'm lost trying to debug within Angular.js itself. I'd really appreciate any tips to set me in the right direction. Thanks.

推荐答案

我能得到的一切使用的纳克-ATTR-占位的指令,而不是直接结合在DOM的属性。例如:

I was able to get everything working correctly in IE using the ng-attr-placeholder directive instead of binding directly to the attribute in the DOM. For example:

<textarea ng-attr-placeholder="Description of the {{ name }}"></textarea>

这篇关于AngularJS 1.2.5脚本错误与文本区域和占位符属性使用IE11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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