使用Angular.js和PHP获取错误:[$ parse:ueoe]

我在php中的li标签内声明 ng-class </ code>时出现以下错误 文件。</ p>

  angularjs.js:107错误:[$ parse:ueoe] http://errors.angularjs.org/1.4.6/$parse/ueoe?p0=%  7B 
at Error(native)
at http://oditek.in/crm/js/angularjs.js:6:416
at Object.s.peekToken(http://oditek.in/crm/js /angularjs.js:209:514)nn在Object.s.primary(http:/ /)的Object.s.object(http://oditek.in/crm/js/angularjs.js:208:336)n /oditek.in/crm/js/angularjs.js:205:503)nn at Object.s.unary(http://oditek.in/crm/js/angularjs.js:205:342)nn at Object .smultiplicative(http://oditek.in/crm/js/angularjs.js:205:88)
at Object.s.additive(http://oditek.in/crm/js/angularjs.js: 204:430)
at Object.s.relational(http://oditek.in/crm/js/angularjs.js:204:265)nn at Object.s.equality(http://oditek.in/ crm / js / angularjs.js:204:90)&lt; a href =“product.php#/ dashboard”ng-class =“{”active“:=”“$ state.includes(”dash board“)}”=“”&gt;
</ code> </ pre>

我正在解释下面的代码。</ p>

 &lt;  ?php 
if(in_array(“Info”,$ userrights)){
//$class=(strpos($_SERVER['REQUEST_URI'],'product.php')|| strpos($ _ SERVER ['REQUEST_URI'],'product.php'))?'class =“active”':'';
echo'&lt; li&gt;&lt; a href =“product.php#/ dashboard” ng-class =“{”active“:$ state.includes(”dashboard“)}”&gt;电子优惠券&lt; b class =“caret”&gt;&lt; / b&gt;&lt; / a&gt;';
}

?&gt;
&lt; ul class =“dropdown-menu”&gt;
&lt; li ui-sref-active =“active”&gt;&lt; a ui-sref =“dashboard”&gt;信息中心&lt; / a&gt; ;&lt; / li&gt;
&lt; li ui-sref-active =“active”&gt;&lt; a ui-sref =“code”&gt;生成优惠券代码&lt; / a&gt;&lt; / li&gt;
&lt; li ui-sref-active =“active”&gt;&lt; a ui-sref =“list”&gt;电子凭证列表&lt; / a&gt;&lt; / li&gt;
&lt; / ul&gt;
&lt; / li&gt ;
</ code> </ pre>

这里我的要求是用户点击上面代码中的任何子菜单,即父菜单( ie-E-Wouchers </ 代码>)也将获得活动类以及子菜单。请帮助我。</ p>
</ div>

展开原文

原文

I am getting the following error while declaring ng-class inside li tag in my php file.

angularjs.js:107Error: [$parse:ueoe] http://errors.angularjs.org/1.4.6/$parse/ueoe?p0=%7B
    at Error (native)
    at http://oditek.in/crm/js/angularjs.js:6:416
    at Object.s.peekToken (http://oditek.in/crm/js/angularjs.js:209:514)
    at Object.s.object (http://oditek.in/crm/js/angularjs.js:208:336)
    at Object.s.primary (http://oditek.in/crm/js/angularjs.js:205:503)
    at Object.s.unary (http://oditek.in/crm/js/angularjs.js:205:342)
    at Object.s.multiplicative (http://oditek.in/crm/js/angularjs.js:205:88)
    at Object.s.additive (http://oditek.in/crm/js/angularjs.js:204:430)
    at Object.s.relational (http://oditek.in/crm/js/angularjs.js:204:265)
    at Object.s.equality (http://oditek.in/crm/js/angularjs.js:204:90) <a href="product.php#/dashboard" ng-class="{" active":="" $state.includes("dashboard")}"="">

I am explaining my code below.

<?php
if(in_array("Info",$userrights)){
            //$class=(strpos($_SERVER['REQUEST_URI'],'product.php') || strpos($_SERVER['REQUEST_URI'],'product.php'))?'class="active"':'';
            echo'<li><a href="product.php#/dashboard" ng-class="{"active": $state.includes("dashboard")}">E-Vouchers<b class="caret"></b></a>';
        }
?>
<ul class="dropdown-menu">
  <li ui-sref-active="active"><a ui-sref="dashboard">Dashboard</a></li>
  <li ui-sref-active="active"><a ui-sref="code">Generate Voucher Code</a></li>
 <li ui-sref-active="active"><a ui-sref="list">E-Voucher List</a></li>
   </ul>
 </li>

Here my requirement is when user will click on any sub menu present in the above code ,the parent menu(i.e-E-Vouchers) will get also active class along with the sub menu.Please help me.

dongxikuo5171
dongxikuo5171 可能重复的角度抛出错误$parse:ueoe意外的表达式结束
接近 5 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐