title: Angular 4: using component variables inside custom validator functions
body: <pre><code>ngOnInit(): void {
  
  this.formBuilder.group({
            nameFormCtrl: ['', this.validateName],
            });
  
  }
  
  validateName(c: FormControl) {
      return c.value === this.name ? null : {
        validateName: {
          valid: false
        }
      };
    }
  </code></pre>
  
  <p>Here <code>this.name</code> should refer to the component, instead, it refers to undefined</p>