【问题标题】:File toggle js isn't working in angular 6文件切换js在角度6中不起作用
【发布时间】:2019-01-16 04:56:02
【问题描述】:

我在主题Urban theme中使用文件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>

请帮帮我,谢谢

【问题讨论】:

    标签: javascript angular typescript angular6


    【解决方案1】:

    然后使用 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
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2018-08-14
      • 1970-01-01
      • 2018-10-25
      • 2021-02-11
      • 1970-01-01
      • 2019-06-13
      • 2019-02-14
      • 1970-01-01
      • 2021-08-12
      相关资源
      最近更新 更多