基于标志复选框禁用并使用Angular 8从表中启用

发布于 2025-01-31 11:35:56 字数 1394 浏览 3 评论 0 原文

我有列表数组,例如:这是getCall。

[ {“主持人”:“ bharath”,“ topic”:“ angular”,“ status”:“计划”,“ emailID”:“ [email  procented] “}, {“主持人”:“ Sayyad”,“ topic”:“ Angular”,“状态”:“有组织”,“ emailId”:“ [email  protected] “ ];

if Logged user is [email protected] is matches to this List of Array emailId 。我需要启用复选框。如果不匹配,则需要禁用。

代码:

private getKtsession(){ console.log('==',this.sesionuser ['emailId']);

this.service.getKtsession().subscribe(data =>{
  console.log('get', data);
  this.ktsessions = data;
  data.filter(user => {
    if(user.emailId === this.sesionUser['emailid']){
      this.isDisabled  =false;
    } else {
      this.isDisabled  =true;
      console.log('else');
      }
  });
});

} HTML代码是

I am having List Array like: this is getCall.

[
{"presenter":"Bharath","topic":"Angular","status":"scheduled","emailId":"[email protected]"},
{"presenter":"Sayyad","topic":"Angular","status":"organized","emailId":"[email protected]"},{"presenter":"Kanchan","topic":"APS","status":"scheduled","emailId":"[email protected]"}
];

if Logged user is [email protected] is matches to this List of Array emailId. i need to enable checkbox . if not matches need to do disable.

Code :

private getktsession(){
console.log('==', this.sesionUser['emailid']);

this.service.getKtsession().subscribe(data =>{
  console.log('get', data);
  this.ktsessions = data;
  data.filter(user => {
    if(user.emailId === this.sesionUser['emailid']){
      this.isDisabled  =false;
    } else {
      this.isDisabled  =true;
      console.log('else');
      }
  });
});

}
HTML code is

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文