我正在通过php
打印复选框值<input type='checkbox' ng-false-value='' ng-true-value='$row->option'>
我动态循环, 但得到以下错误 https://docs.angularjs.org/error/ngModel/constexpr?p0=ngTrueValue&p1=Canel
在html中ng-true-value='$row->option'
打印,如ng-true-value="Canel"
有没有办法像这样ng-true-value="'Canel'"
,这意味着doublequte然后单引号然后值然后单引号然后双引号(类似"'Canel'"
)
答案 0 :(得分:0)
<?php
echo "<input type='checkbox' ng-false-value='' ng-true-value=\"'$row->option'\">";
如果$row->option
test ,则会输出:
<input type='checkbox' ng-false-value='' ng-true-value="'test'">