[SOLVED] Push value from input to object array and update tab names labels- Angular


This Content is from Stack Overflow. Question asked by bel

I have a reactive form and I am using Material Angular, with a tab group and the tab names comes from an array, I need to add the possibility of changing those tabs names for new ones. If a write a new title in the input I need to update the name of the tab label.


I’m getting the value from the input, but I can’t figure it out how to send it to the names of the tabs:


this.newTitleArm = selection.formdata.titleTextArms;



The problem is that you are not updating the respective tab name anywhere, neither in your submit, nor in your updateData.

You submit the value, but you are not updating the tabs.

For example, in your submit method add this hard-coded update and then press the Save button:

this.tabs[0].name = "test";

Because now you updated the first tab’s name, you should see the change.

This Question was asked in StackOverflow by bel and Answered by Vasileios Kagklis It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?