title: Angular: disable form control properly so that I can read value later
body: <p>So here is my angular reactive form</p>
  <pre><code>  zoneEntryForm = new FormGroup({
      code: new FormControl(''),
      zonename: new FormControl(''),
    });
  </code></pre>
  <p>I am getting output by this code:</p>
  <pre><code>  onSubmit() {
      // TODO: Use EventEmitter with form value
      console.warn(this.zoneEntryForm.value);
    }
  </code></pre>
  <p>output</p>
  <p><a href="https://i.stack.imgur.com/AxHc8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AxHc8.png" alt="enter image description here" /></a></p>
  <p><strong>[Note: code is a number, zone is a string]</strong></p>
  <p>Now I want to read value from code and zone , but I need to set code field disable and still I want to read value from code field. (code is coming from db, I will have to make some get code function to set it, user won't input it. Later I need to send this code and zone name to somewhere else</p>
  <p>both field should be blank by default</p>
  <p>So here is my attempt</p>
  <p><strong>attempt 1:</strong></p>
  <pre><code>  zoneEntryForm = new FormGroup({
      code: new FormControl({value: '', disabled: true}),
      zonename: new FormControl(''),
    });
  </code></pre>
  <p><strong>output:</strong>
  <a href="https://i.stack.imgur.com/SJ2eT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SJ2eT.png" alt="enter image description here" /></a></p>
  <p>see, now code field is no longer read by <code>onSubmit</code></p>
  <p><strong>Attempt : 2</strong></p>
  <pre><code>  zoneEntryForm = new FormGroup({
      code: new FormControl({disabled: true}),
      zonename: new FormControl(''),
    });
  </code></pre>
  <p><strong>output :</strong></p>
  <p><a href="https://i.stack.imgur.com/A1ky2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A1ky2.png" alt="enter image description here" /></a></p>
  <p>Now my default blank value &quot;&quot; is gone</p>
  <p>So How can I make code disabled and read from it properly at the same time?</p>