繁体   English   中英

文件切换 js 在 angular 6 中不起作用

[英]File toggle js isn't working in angular 6

我在主题城市主题中使用文件 toggle.js

在 html 聊天框img文件 toggle.js 硬代码 => 运行良好。 但我使用代码 angular 6 => toggle.js 不起作用

描述:当我点击一个用户名然后显示聊天框

这是我的代码(我使用硬编码 && 代码角度 6):

<a *ngFor="let item of data;" href="javascript:;"> => not working
            <span class="status-online"></span>
            <span>{{item.Username}}</span>
          </a>
          <a href="javascript:;"> => hardcode working
            <span class="status-online"></span>
            <span>Peter</span>
          </a>

请帮帮我,谢谢

然后使用 EventEmitter 进行切换。 像下面这样的东西。

appchild.component.ts

import { Component, Input, EventEmitter, Output } from '@angular/core';

@Component({
  selector: 'app-child',
  template: `<button class='btn btn-primary' (click)="handleclick()">Click me</button> `
})

export class AppChildComponent {
  handleclick() {
    // Add toggle code here or set the flag to show/hide
  }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM