Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.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
Angularjs 指令名称中的冒号-ng:repeat而不是ng repeat_Angularjs - Fatal编程技术网

Angularjs 指令名称中的冒号-ng:repeat而不是ng repeat

Angularjs 指令名称中的冒号-ng:repeat而不是ng repeat,angularjs,Angularjs,显然,这里的代码是有效的 <tr ng:repeat="item in invoice.items"> <td><input type="text" ng:model="item.description"class="input-small"></td> <td><input type="number" ng:model="item.qty" ng:required c

显然,这里的代码是有效的

    <tr ng:repeat="item in invoice.items">
        <td><input type="text" ng:model="item.description"class="input-small"></td>           
        <td><input type="number" ng:model="item.qty" ng:required class="input-mini"></td>
        <td><input type="number" ng:model="item.cost" ng:required class="input-mini"></td>
        <td>{{item.qty * item.cost | currency}}</td>
        <td>
            <a href ng:click="removeItem($index)">&times</a>
        </td>
    </tr>

{{item.qty*item.cost | currency}}

但是他为什么用冒号呢

医生 不要说这个语法。

来自文档:

最佳实践:首选使用破折号分隔格式(例如,ngBind代表ngBind)。如果要使用HTML验证工具,可以改用数据前缀版本(例如,数据ng bind for ngBind)由于遗留原因,上述所示的其他形式被接受,但我们建议您避免使用它们


--.

在“正常化”下签出。好的,我现在知道了允许的确切位置。谢谢,先生。我想答案是,他们在早期使用
时将约定转换为使用
-
,并且需要保持向后兼容