小编Log*_*gik的帖子

如何在 *ngFor 中的数组元素之间放置逗号?

我想知道如何在数组元素之间放置逗号,而行尾没有逗号。有类似的问题,但我的有点不同,因为我使用 *ngFor 指令来显示文本:

<span *ngFor="let style of styles">
    {{style}} //If I put a comma after the text, there would be a comma at the end of the line after the  
              //last element was displayed
<span>
Run Code Online (Sandbox Code Playgroud)

解决我的问题的方法是什么?

html javascript typescript angular-directive angular

2
推荐指数
1
解决办法
469
查看次数

该类型有多少个不同的值?

我有一个给定的类型

type Foo = Either (Bool, ()) (Maybe Ordering)
Run Code Online (Sandbox Code Playgroud)

我知道该类型Bool有两个不同的值:TrueFalse

假设,以下类型是否正确:

type Foo = Either (Bool, ()) (Maybe Ordering)
Run Code Online (Sandbox Code Playgroud)

2+2+1+2+3 = 10考虑到其他类型的构建方式,具有不同的值:

data Either a b = Left a | Right b
data Maybe a = Just a | Nothing
data Ordering = EQ | LT | GT
Run Code Online (Sandbox Code Playgroud)

haskell types

0
推荐指数
1
解决办法
114
查看次数