Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/396.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-如何在收件箱中获取未替换的值_Javascript_Html_Angularjs - Fatal编程技术网

Javascript AngularJS-如何在收件箱中获取未替换的值

Javascript AngularJS-如何在收件箱中获取未替换的值,javascript,html,angularjs,Javascript,Html,Angularjs,编辑: 事实上,我从后端日志服务器检索日志,它是json格式的。某些键可能有特殊的字符。然后我尝试用AngularJS在UI中呈现这些日志数据 发生了什么事 原始日志json数据是正确的,比如你和我 当使用{{data}}时,它将成为您&;UI中的me,默认由$sce引起,$sce已启用。 改为,如预期所示-你和我 还有一个收件箱,我想获得用户点击的原始数据。我使用了,但在函数verify_enabled中,传递的参数变成转义数据-you&;我 在angularJs中,一些特殊字符(

编辑: 事实上,我从后端日志服务器检索日志,它是json格式的。某些键可能有特殊的字符。然后我尝试用AngularJS在UI中呈现这些日志数据

发生了什么事

原始日志json数据是正确的,比如你和我 当使用{{data}}时,它将成为您&;UI中的me,默认由$sce引起,$sce已启用。 改为,如预期所示-你和我 还有一个收件箱,我想获得用户点击的原始数据。我使用了,但在函数verify_enabled中,传递的参数变成转义数据-you&;我 在angularJs中,一些特殊字符(如&)在html中显示时将被转义

    "&" -> "&",
    "<" -> "&lt;",
    ">" -> "&gt;",

我已经试着找出问题所在。不知道你想发生什么。控制台正在为我显示原始字符。@Razzidino抱歉,我试图在代码段中重现我的问题。但失败了。看起来像这样
   <span>{{data}}</span> 
   //{{}} the bind will escape it from '&' to "&amp;"
<span ng-bind-html="data"></span>
// this will output raw &
// raw data in $scope.data = "you & me";
<input  type="checkbox"   
      id="{{data}}_id"
      value="{{data}}"
      ng-checked="verify_enabled(data)"
      ng-click="toggle_enabled(data)" /> 
// the {{data}} will be escaped to "you &amp; me"