简体   繁体   中英

File toggle js isn't working in angular 6

I using file toggle.js in theme Urban theme

In html chatbox img file toggle.js hard code => It's working good. But I using code angular 6 => toggle.js not working

Description: When I click a username then show chatbox

This is my code(I using hardcode && code angular 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>

Please help me, thanks

Use EventEmitter for toggle then. something like below.

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
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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