douyazi1129
2017-01-17 15:40
浏览 135
已采纳

ng-true-value非常量表达式

i am printing checkbox value something following by php

<input type='checkbox' ng-false-value='' ng-true-value='$row->option'>

i am looping this dynamically, but getting following error https://docs.angularjs.org/error/ngModel/constexpr?p0=ngTrueValue&p1=Canel

in html this ng-true-value='$row->option' printing like ng-true-value="Canel" is there any way to do like this ng-true-value="'Canel'", thats mean doublequte then single quote then value then single quote then double quote (something like "'Canel'")

图片转代码服务由CSDN问答提供 功能建议

我正在打印复选框值,后面是php

 &lt  ; input type ='checkbox'ng-false-value =''ng-true-value ='$ row-&gt; option'&gt; 
   
 
 

我是 动态循环, 但是会出现以下错误 https:/ /docs.angularjs.org/error/ngModel/constexpr?p0=ngTrueValue&p1=Canel

在html中 ng-true-value ='$ row - &gt;选项'打印,如 ng-true-value =“Canel” 有任何方法可以这样做 ng-true-value =“'Canel'” ,这意味着doublequte然后单引号然后值然后单引号然后双引号(类似“'Canel'”

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douyi3833 2017-01-17 15:48
    已采纳
    <?php
    echo "<input type='checkbox' ng-false-value='' ng-true-value=\"'$row->option'\">";
    

    If $row->option is test it will output:

    <input type='checkbox' ng-false-value='' ng-true-value="'test'">
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题