1
I have two lists in my component.
listPermissoesOfUser: UsuarioPermissoes[];
listAnotherPermissoes: UsuarioPermissoes[];
And when I upload the page, I display them in a primeNG picklist (Two containers). Only when I press, I need to buy the two lists, whatever you have on listPermissionsOfUser cannot appear in the listAnotherPermissions
The function that loads the page information is below:
loadPage() {
this.idUser = this.route.snapshot.params.id;
this.route.paramMap.pipe(
switchMap(params => this.usuarioPermissoesService.getPermissoesOfUser(+params.get("id")))
).subscribe(
(listPermissoesOfUser: UsuarioPermissoes[]) => {this.listPermissoesOfUser = listPermissoesOfUser; },
(error) => {console.log(error); }
);
this.usuarioPermissoesService.getListFuncionalidades().subscribe(
(listAnotherPermissoes: UsuarioPermissoes[]) => {this.listAnotherPermissoes = listAnotherPermissoes},
(error) => {console.log(error); }
);
//Funcionalidades que o usuario tem, não aparece na listAnotherPermissoes
}
Any idea how to do that?
Isn’t it better to already come ready in return, IE, where does this information come from? wouldn’t it be from there, I did formatted all the information.
– novic
You mean in the database? What would be the command for a
SELECT
do a search and do not return the lines in common with the "id_usuario"?– Edward Ramos
So your problem isn’t there and your question turns out to be another ...
– novic
I asked that nut I’ve tried to do this in the database, and the query does not work because of the few Fk’s in the tables. I’ve tried using LEFT JOIN, Where IS NOT, <> among others, ma snenhum meets what I need, so I find it easier to try doing it in Angular or maybe in PHP.
– Edward Ramos
Look if this research is not working out if you should have problems in your back end and then it gets complicated to say anything.
– novic
I have two SELECT’s in DB, one of them searches the user permissions; the other searches all permissions. In the second SELECT, I would have to do a search that, because of the way the tables are turned on, would not have to do in a query, would have to make two separate queries and bring the result of them, but if I do this, I would have to do in PHP. Do in PHP or Angular would in the same.
– Edward Ramos
If you want, I can post the tables so you can analyze the situation better.
– Edward Ramos
It has to be in another question, because, would be two questions.
– novic
I created another question: Mysql - Compare two lists and filter information
– Edward Ramos