我正在使用angularfire2为我的离子应用程序实现Firebase。我需要根据实时数据库检查或取消选中输入。这是我的实现。
<input type="checkbox" name="onoffswitch" [checked]={{(booked | async)?.booked}} >
这给了我HTML错误。
答案 0 :(得分:1)
因为public void RemoveSewingCards(List<SewingCard> sewingCards, ApplicationDbContext context)
{
//iterating through sewingCards list
foreach (var sewingCard in sewingCards)
{
var sewingCardType = sewingCard.GetType();
var dbSet = context.Set(sewingCardType).Remove(sewingCard);
}
}
期望使用一个不需要用括号括起来的变量。
您应该能够执行以下操作;
[checked]
OR
<input type="checkbox" name="onoffswitch" [checked]="(booked | async)?.booked">
请仔细阅读Angular Documentation中的模板语法。它更详细地说明了属性绑定。