在ng2中创建中继器的首选模式是什么? [英] what is the preferred pattern for creating a repeater in ng2?

查看:40
本文介绍了在ng2中创建中继器的首选模式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ng2中创建中继器的首选模式是什么?我当时以为我可以用NgFor做到这一点,但是根据angular.io,不推荐使用NgFor: https://angular.io/api/common/NgFor/.但是,angular.io上的同一页面没有说明应用作替代方式的中继器模式.这里的任何人都可以提供一些有关在ng2应用中实现中继器的最新模式的见识吗?

What is the preferred pattern for creating a repeater in ng2? I was thinking that I might do this with NgFor but NgFor is deprecated according to angular.io: https://angular.io/api/common/NgFor/. However, the same page on angular.io doesn't state the repeater pattern that should be used as an alternative. Can anyone here provide some insight on the latest patterns being used to implement repeaters in ng2 apps?

推荐答案

在大多数情况下,您希望使用快捷版本: * ngFor .在后台,这被实现为 ngForOf .如果您坚持使用快捷方式,则不必担心幕后"更改.

In most cases, you want to use the short-cut version: *ngFor. Behind the scenes, this is implemented as ngForOf. If you stick to the short-cut version, you don't have to worry about the "behind the scenes" changes.

有关更多信息,请参见此链接:什么是Angular [ngForOf]用法

See this link for more information: What is Angular [ngForOf] usage

这篇关于在ng2中创建中继器的首选模式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆