Hey there! I'm currently working with a component that includes the input @Input() userId: number[] = [];
to receive a list of user IDs.
Specifically, I have integrated this component into another one, such as the news
component:
<kt-user-post-list-select [userId]="noWriterIdList" (selectedUserId)="getSelectionUserList($event)">
</kt-user-post-list-select>
When I make a request to the server to add news, it returns a list of IDs like [1,2,3]
. In order to update the kt-user-post-list-select
component with these IDs using [userId]="noWriterIdList"
, I encounter an issue: I want the list changes to be tracked and trigger the following function:
validateUSerIsWriter(ids: number[]): void {
for (let id = 0; id < ids.length; id++) {
let user = this.users.find(x => x.userId = id);
if (user != null) {
user.isDeleted = true;
}
}
}
Unfortunately, this functionality does not seem to be working as expected.
Any suggestions on how to tackle this problem?