这是我在主页中调用的手风琴组件的 ts 文件。但是,我想使用参数 showOnHome 仅显示布尔值为 true 的参数。我怎样才能做到这一点?
@Component({
selector: "app-faq",
templateUrl: "./faq.component.html",
styleUrls: ["./faq.component.css"],
})
export class FaqComponent implements OnInit {
data = [
{
id: 1,
question: "question1",
answer: [
"answer here",
],
bullet: false,
showOnHome: true,
},
{
id: 2,
question: "question2",
answer: [
"answer2",
],
bullet: false,
showOnHome: false,
},]```
Called On Home Page as:
``` <app-faq></app-faq> ```