File toggle js isn't working in angular 6

Viewed 64

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

1 Answers

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