title: Angular material Editable table
body: <p>I am trying to achieve below screen using angular material. </p>
  
  <p><a href="https://i.stack.imgur.com/UDLhE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UDLhE.png" alt="enter image description here"></a></p>
  
  <p>Here is my code so far  </p>
  
  <p>html component code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;mat-card class="FactorAllocationCard"&gt;
    &lt;mat-card-header&gt;
      &lt;mat-card-title&gt;Allocate Factors&lt;/mat-card-title&gt;
      &lt;span class="spacer"&gt;&lt;/span&gt;
      &lt;button mat-raised-button color="primary"&gt;
        Save
      &lt;/button&gt;
    &lt;/mat-card-header&gt;
    &lt;mat-divider&gt;&lt;/mat-divider&gt;
    &lt;mat-card-content&gt;
      &lt;div class="factalloctable"&gt;
        &lt;table mat-table [dataSource]="dataSource" class="mat-elevation-z8"&gt;
          &lt;ng-container matColumnDef="Description"&gt;
            &lt;th mat-header-cell *matHeaderCellDef&gt;Factor&lt;/th&gt;
            &lt;td mat-cell *matCellDef="let element"&gt;{{ element.Description }}&lt;/td&gt;
          &lt;/ng-container&gt;
          &lt;!-- Edit Update Column --&gt;
          &lt;ng-container matColumnDef="Action"&gt;
            &lt;th mat-header-cell *matHeaderCellDef&gt;
              Allocate
            &lt;/th&gt;
            &lt;td mat-cell *matCellDef="let element"&gt;
              &lt;button mat-button&gt;
                &lt;mat-icon class="mat-icon-factor-def" color="primary"
                  &gt;remove_circle&lt;/mat-icon
                &gt;
              &lt;/button&gt;
              &lt;mat-slider thumbLabel step="0.1" max="30" min="0" color="primary"&gt;
              &lt;/mat-slider&gt;
              &lt;mat-icon class="mat-icon-factor-def"&gt;add_circle&lt;/mat-icon&gt;
            &lt;/td&gt;
          &lt;/ng-container&gt;
          &lt;ng-container matColumnDef="Value"&gt;
            &lt;th mat-header-cell *matHeaderCellDef&gt;Allocated Value&lt;/th&gt;
            &lt;td mat-cell *matCellDef="let element"&gt;{{ element.Value }}&lt;/td&gt;
          &lt;/ng-container&gt;
          &lt;tr mat-header-row *matHeaderRowDef="displayedColumns"&gt;&lt;/tr&gt;
          &lt;tr mat-row *matRowDef="let row; columns: displayedColumns"&gt;&lt;/tr&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/mat-card-content&gt;
  &lt;/mat-card&gt;</code></pre>
  </div>
  </div>
  
  typescript code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import { Component, OnInit } from '@angular/core';
  import { FactorsService } from './../../factors-services';
  import { MatTableDataSource } from '@angular/material/table';
  
  @Component({
    selector: 'app-factor-cat',
    templateUrl: './factor-cat.component.html',
    styleUrls: ['./factor-cat.component.css'],
  })
  export class FactorCatComponent implements OnInit {
    CurrentAllocation = [];
  
    constructor(public factorsservice: FactorsService) {}
    displayedColumns: string[] = ['Description', 'Action', 'Value'];
    dataSource = new MatTableDataSource(this.factorsservice.Choosen);
    ngOnInit(): void {}
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to save only after the user make all allocations and press Save. Also value column needs to be updated when ever the user changes slider values. + and - at the end of the slider could be used to change the step value of the slider.</p>
  
  <p>I searched a lot for similar kind of questions but couldn't find any. </p>