I'm trying to get selected data from the component nb-select and pass it to ng2 smart table , after implementing the code below the nb-select diplayed correctly in the cell of the table also I can see the the data selected but in nb-list Component not where I want I hope explained well my problem, sorry for my english , I'm stuck since one week
nb-list.html :
<nb-select
[(ngModel)]="selectedlist"
multiple
placeholder="Liste TPE disponible"
(ngModelChange)="change($event)"
>
<nb-option *ngFor="let tpe of listOfTpeNoneBinded" [value]="tpe.sn">
{{ tpe.sn }}
</nb-option>
</nb-select>
nb-list.ts :
import { Component, Input, OnInit } from "@angular/core";
import { Apollo } from "apollo-angular";
import { UserService } from "../user/user.service";
@Component({
selector: "ngx-nb-list",
templateUrl: "./nb-list.component.html",
styleUrls: ["./nb-list.component.scss"],
})
export class NbListComponent implements OnInit {
listOfTpeNoneBinded;
selectedlist;
// @Input() value;
constructor(private apollo: Apollo, private userService: UserService) {}
ngOnInit(): void {
this.getNoBinded();
}
change(event) {
console.log(event);
}
getNoBinded() {
this.apollo
.query<any>({ query: this.userService.getNoBinded() })
.subscribe(({ data }) => {
console.log("getNoBindedTPE", data);
this.listOfTpeNoneBinded = data.getNoBindedTPE;
});
}
}
my code in ng2 smart table
bindedSn: {
title: "bindedSn",
type: "html",
editor: {
type: "custom",
valuePrepareFunction: (cell, row) => {
return row;
},
// data exists in nb list compoent i want to get the data from nb list component to here
component: NbListComponent,
},
},