Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS v1.2.5脚本错误,使用IE11时出现textarea和占位符属性_Javascript_Jquery_Internet Explorer_Angularjs - Fatal编程技术网

Javascript AngularJS v1.2.5脚本错误,使用IE11时出现textarea和占位符属性

Javascript AngularJS v1.2.5脚本错误,使用IE11时出现textarea和占位符属性,javascript,jquery,internet-explorer,angularjs,Javascript,Jquery,Internet Explorer,Angularjs,我有一个AngularJSV1.2.5表单,在IE11中不起作用。它在Firefox、Chrome和Safari中运行良好。我的表单在占位符属性中使用带插值的文本区域 <body ng-controller="MainCtrl"> <p>Hello {{ name }}!</p> <textarea rows="4" placeholder="Description of the {{ name }}"></textare

我有一个AngularJSV1.2.5表单,在IE11中不起作用。它在Firefox、Chrome和Safari中运行良好。我的表单在占位符属性中使用带插值的文本区域

  <body ng-controller="MainCtrl">
    <p>Hello {{ name }}!</p>
    <textarea rows="4" placeholder="Description of the {{ name }}"></textarea>
  </body>
这是一个在Firefox、Chrome、Safari中运行良好的Plnkr,但在IE11中不起作用。


我无法在Angular.js中调试。我真的很感激任何能给我指引正确方向的建议。谢谢。

z上面提到过,这是一个错误-

作为一项临时措施,我编写了一个指令来处理IE中文本区域的占位符。只要不是IE,该指令将设置占位符属性。这应该只对文本区域(不是所有占位符)是必需的

用法:

<textarea rows="4" data-placeholder-attr="Description of the {{ name }}"></textarea>


希望这对其他人有帮助。。。IE-urgh.

我在使用角度平移库()时遇到了同样的问题

特别是在尝试使用“指令方式”对包含索引的动态文本进行翻译时。我用“过滤方式”替换了指令进行翻译,问题得到了解决

之前:

{{scope.textInArray[someIndex]}

之后:

{{scope.textInArray[someIndex]| translate}}


注意:甚至没有将“{…}”作为属性值包含在translate中,或者用函数调用替换它,就解决了我的问题。

我能够在IE中使用指令而不是直接绑定到DOM中的属性,使一切正常工作。例如:

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


也许要做的第一件事就是复制它。继续工作。同时,希望能找到其他有这个问题的人。Itr看起来像是一个ajax请求,你能试着在你的小提琴里假装ajax吗?JSFIDLE有一个URL,你可以发布到它并获取相同的数据,在dev tools中检查你的网络选项卡,当你发现错误时,只需发布你得到的信息即可。重复:你应该把这个答案贴在前面提到的问题上。然后人们可以在那里接受它,你可以从SO中删除你自己的问题。好吧,我不太愿意强调我自己的答案作为解决方案。Zsong指出,这是一个bug——上面的链接就是答案。我的指示是一项临时措施。谢谢。只需使用
ng attr占位符
而不是
占位符
。不需要新指令。这应该被WSER接受,不需要额外的代码。此解决方案适用于IE11/1.4.8。谢谢
<textarea rows="4" data-placeholder-attr="Description of the {{ name }}"></textarea>
<textarea ng-attr-placeholder="Description of the {{ name }}"></textarea>