gpt4 book ai didi

angularjs - meteor Angular 教程 : Todos List's tag

转载 作者:行者123 更新时间:2023-12-03 09:31:16 26 4
gpt4 key购买 nike

我正在尝试通过 https://www.meteor.com/tutorials/angular/templates 上的 Meteor 教程有一部分我想不通在他们的 client/main.js 中:

<body>
<div class="container" ng-app="simple-todos">
<todos-list></todos-list>
</div>
</body>

他们只是放了一个<todos-list>标记在中间,然后加载该模板。我不知道 todos-list 如何转换为实际模板,是否有一些名称转换约定将“todos-list”转换为“todosList”并以这种方式引用?

提前致谢

最佳答案

这是由于 AngularJS 执行的规范化。

Normalization

Angular normalizes an element's tag and attribute name to determine which elements match which directives. We typically refer to directives by their case-sensitive camelCase normalized name (e.g. ngModel). However, since HTML is case-insensitive, we refer to directives in the DOM by lower-case forms, typically using dash-delimited attributes on DOM elements (e.g. ng-model).

The normalization process is as follows:

  1. Strip x- and data- from the front of the element/attributes.
  2. Convert the :, -, or _-delimited name to camelCase.

AngularJS 文档链接 here

关于angularjs - meteor Angular 教程 : Todos List's <todos-list></todos-list> tag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36817319/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com