title: Update member value of all instances of Model-based Objects in array?
body: <p>I am enjoying learning Angular2+Typescript and and wondering if there is a way to update all the values of a specific member of all model-based objects in an array, very simply (e.g. one-liner).</p>
  
  <p>For example, say you had this model:</p>
  
  <pre><code>export class x1Model{
      status:string = "";
      isAssigned:boolean = false;
      isDefault:boolean = false;
      isRequested:boolean = false;
  
      constructor(public label:string = ""){}
  
      toggle():void{
          this.isDefault = !this.isDefault
      }
  }
  </code></pre>
  
  <p>And you had this service:</p>
  
  <pre><code>export class x1Service{
      x1s = [
          new x1Model("Orange Racer"),
          new x1Model("Wife's Sunday Driver"),
          new x1Model("Weekend Bucket")
      ];
  
      addX1(x1:x1Model){
          this.x1s = [...this.x1s, x1];
      }
  
      toggleDefault(x1:x1Model){
          //get index of x1 to set as default
          const x = this.x1s.indexOf(x1);
  
          //set all as default=false
          set(item.default,false,this.x1s);
  
          //toggle passed x1 as default
          x1.toggle();
  
          //update global list
          this.x1s = [
              ...this.x1s.slice(0,x),
              x1,
              ...this.x1s.slice(x+1)                
          ];
  
      }
  }
  </code></pre>
  
  <p>So what I'm wondering is if there is a nifty way to do what I've shown as</p>
  
  <pre><code>set("a model's variable", "the new value", "the list of objects of Model type");
  </code></pre>
  
  <p>without having to write a "set" function.</p>
  
  <p>I just think it would be nice if the Model concept could, or is, extended to allow for a quick way to pass an override/update/mask version of one or more variables of a model against any number of objects of that model type, and have the update happen.</p>