debabratapatra / angular-tree-grid

Angular 10 Tree Grid
https://curiouslinks.com/pages/angular-tree-grid/demo
MIT License
31 stars 17 forks source link

access row_data into custom component #19

Closed tarangsachdev92 closed 4 years ago

tarangsachdev92 commented 4 years ago

I want to pass data to the custom component,

onComponentInit: (component) => { component.value = component.row_data }

but not it is undefined.

tarangsachdev92 commented 4 years ago

I tried and able to get row_data from the component its self so no need to do that.

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

@Component({
  selector: 'app-my-component-name',
  templateUrl: './my-component-name.component.html',
  styleUrls: ['./my-component-name.component.scss']
})
export class MyComponentNameComponent implements OnInit {
  @Input() value: any;
  @Input() cell_value: any;
  @Input() row_data: any;

  constructor() { }

  ngOnInit() {
    console.log(this.cell_value);
    console.log(this.row_data);
  }
}