Ho can I get the username of object from select list?

I have select list contains names, how can I get the name! I want to insert name in database and not the id! here is it my ts file: selectuser() { this.UtilisateurService.findAll().then((res) => { let id = ”; this.listuser = res.map(function (obj: any) { return { id: obj.id, text: obj.username, }; }); this.listuser.splice(0, 0, { […]

By drnwork
Published
Categorized as angular, typescript Tagged ,

How can I save data on close action of expansion panel in angular?

I am saving all inputs Note with Save Click ! How can I save data whenever I close a panel ? I need to save data of Notes of each panel.Does anyone has an idea how to do that? here is it my interface: My Ts File: getSouCategories(id:number){ return this.LExamenSousCategorieService.getSousCategories(id).then((res)=>{ this.listSousCategorie = res; }) } […]

By drnwork
Published
Categorized as angular, angular-material, typescript Tagged , ,

How to stop expand panel after open it from refreshing?

I have Service getSousCategorie when I expand the panel to get the Note value from database !! is there any solution to stop it from refreshing from database, until I click on Save Button ? HTML Code: <div class="modal-body" style="width:500px ; height:600px; overflow-y: auto" > <mat-accordion > <mat-expansion-panel *ngFor="let i of listCategorie" class="parentPanel" > <mat-expansion-panel-header […]

By drnwork
Published
Categorized as angular, html, typescript Tagged , ,

How to change button position in angular?

I want to change the button position in my html code but I got a problem in the j like in the photo below ! I want to put the button in the footer of the modal ! the Output (button in the bottom) : here is it my code: <div class="modal-header" > <h6 class="modal-title" […]

By drnwork
Published
Categorized as angular, html Tagged ,

How can I bind data in ngFor?

I have a problem in input text, when I write in one input it changes in the other input as well ! how can I fix that ! HTML code: <mat-expansion-panel class="childPanel" [expanded]="true" hideToggle disabled style=" background:#F2EDFF;" *ngFor="let i of listSousCategorie" > <div class="childPanel_body2 mat-badge-large" fxLayout="row" fxFlex fxLayoutAlign="start center" > <div style="padding-left:1em" fxFlex="grow" >{{i.libelle}} {{i.id}}</div> […]

By drnwork
Published
Categorized as angular, html Tagged ,

How can I stop input text from writing in 2 inputs?

I have a problem in input text, when I write in one input it changes in the other input as well ! how can I fix that here is it my code: <mat-expansion-panel class="childPanel" [expanded]="true" hideToggle disabled style=" background:#F2EDFF;" *ngFor="let i of listSousCategorie" > <div class="childPanel_body2 mat-badge-large" fxLayout="row" fxFlex fxLayoutAlign="start center" > <div style="padding-left:1em" fxFlex="grow" […]

By drnwork
Published
Categorized as angular, html Tagged ,

How to get list data in modal?

I want to get listCategorie from getcategorie function and put it in my modal but it comes empty! how can I fix that ? here is it my code: getcategorie() { this.LCategorieService.getCategories(this.id).then((res )=> { this.listCategorie = res; }) } async addNoteModal() { const dialogConfig = new MatDialogConfig(); dialogConfig.disableClose = false; dialogConfig.autoFocus = true; dialogConfig.data = […]

By drnwork
Published
Categorized as angular, modal-dialog, typescript Tagged , ,

How can I refresh expand panel in angular?

I have a problem in getting the id’s of the card of categorie. When I click on the Note Button it insert data in a table and I am going to use their id to open the cards of sousCategorie. but I can get the id (in yellow color) only when i close the model […]

By drnwork
Published
Categorized as angular, angular-material, html, typescript Tagged , , ,

How to fix input in For loop (angular)?

I want to add input in expansion panel for every souCat√©gorie but I can’t enter text in the input it keeps disappear whenever I click on be cause of for loop can anyone help me to fix it ! <mat-accordion > <mat-expansion-panel *ngFor="let i of listCategorie" class="parentPanel" (click)="getSouCategories(i.id)" > <mat-expansion-panel-header class="parentPanel_header"> <mat-panel-title> {{i.libelle}} {{i.id}} <!– […]

By drnwork
Published
Categorized as angular, angular-material, html Tagged , ,

How can I check id data exists in database in angular?

I want to check if item exists in database how can I check that ? here is it my code: this.selectedObjectif1.map((el, i) => ( this.obj1.push({ libelle: el.label, id_examen: el.value.id })) as any); for (let item of this.obj1) { this.LExamenObjectifService.addObjectif(item).then(res => { console.log(‘typeeee’); }) } Source: Angular Questions

By drnwork
Published
Categorized as angular, typescript Tagged ,

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq