 component we has some like
@ViewChildren(FocusOnErrorDirective) fields:QueryList<FocusOnErrorDirective>
check() {
    const fields=this.fields.toArray();
    for (let field of fields)
    {
      if (field.invalid)
      {
        field.focus();
        break;
      }
    }
  }

You can see in action in the stackblitz
UPDATE always the things can improve:
Why not create a directive that applied to the form?
@Directive({
  selector: '[focusOnError]'
})
export class FocusOnErrorDirective {

  @ContentChildren(NgControl) fields: QueryList<NgControl>

  @HostListener('submit')
  check() {
    const fields = this.fields.toArray();
    for (let field of fields) {
      if (field.invalid) {
        (field.valueAccessor as any)._elementRef.nativeElement.focus();
        break;
      }
    }
  }

So, our.html it's like
<form [formGroup]="myForm" focusOnError>
  <input type="text" formControlName="familyName" />
  <input type="text" formControlName="appointmentCode" />
  <button >click</button>
</form>

See the stackblitz
Even more, if we use as selector form
@Directive({
  selector: 'form'
})

Even we can remove the focusOnError in the form
<form [formGroup]="myForm" (submit)="submit(myForm)">
..
</form>

Update 2 Problems with formGroup with formGroup. SOLVED
NgControl only take account the controls that has [(ngModel)], formControlName and [formControl], so. If we can use a form like
myForm = new FormGroup({
    familyName: new FormControl('', Validators.required),
    appointmentCode: new FormControl('', Validators.required),
    group: new FormGroup({
      subfamilyName: new FormControl('', Validators.required),
      subappointmentCode: new FormControl('', Validators.required)
    })
  })

We can use a form like:
<form [formGroup]="myForm"  focusOnError (submit)="submit(myForm)">
  <input type="text" formControlName="familyName" />
  <input type="text" formControlName="appointmentCode" />
  <div >
    <input type="text" [formControl]="group.get('subfamilyName')" />
    <input type="text" [formControl]="group.get('subappointmentCode')" />
  </div>
  <button >click</button>
</form>

where in.ts we has
get group()
  {
    return this.myForm.get('group')
  }

Update 3 with Angular 8 you can get the descendants of the children, so it's simply write
 @ContentChildren(NgControl,{descendants:true}) fields: QueryList<NgControl>


A: well, just for funny stackblitz. If we has a formControl, we can inject ngControl that it's the control itself. So we can get the formGroup. I control the "submited" making a work-around in the app.component
<button (click)="check()">click</button>

  check() {
    this.submited = false;
    setTimeout(() => {
      this.submited = true;
    })
  }

The directive is like
export class FocusOnErrorDirective implements OnInit {
  @HostListener('input')
  onInput() {
    this._submited = false;
  }

  //I used "set" to avoid ngChanges, but then I need the "ugly" work-around in app.component
  @Input('focusOnError')
  set submited(value) {
    this._submited = value;
    if (this._submited) {  ((is submited is true
      if (this.control && this.control.invalid) { //if the control is invalid
        if (this.form) {
          for (let key of this.keys)  //I loop over all the
          {                           //controls ordered
            if (this.form.get(key).invalid) {  //If I find one invalid
              if (key == this.control.name) {  //If it's the own control
                setTimeout(() => {
                  this.el.nativeElement.focus()   //focus
                });
              }
              break;                           //end of loop
            }
          }
        }
        else
          this.el.nativeElement.focus()
      }
    }
  }
  private form: FormGroup;
  private _submited: boolean;
  private keys: string[];

  constructor(@Optional() private control: NgControl,  private el: ElementRef) {  }

  ngOnInit() {
    //in this.form we has the formGroup.
    this.form = this.control?this.control.control.parent as FormGroup:null;
    //we need store the names of the control in an array "keys"
    if (this.form)
    this.keys = JSON.stringify(this.form.value)
     .replace(/[&\/\\#+()$~%.'"*?<>{}]/g, '')
     .split(',')
     .map(x => x.split(':')[0]);
  }
}

High Speed 2 is a flawed Government plan to build a new high speed rail line linking London, the West Midlands, Leeds and Manchester. The total construction cost of the entire project is estimated at £42.6 billion, plus another £8 billion for rolling stock – an unprecedented level of expenditure for a single project ever proposed by a British Government in peacetime. If you agree HS2 is not in the national interest please join us today.
The Government’s own figures show that returns for Phase 1 (London to West Midlands) have fallen from £2.40 for every £1 of public money spent to £1.40. Comparable figures for the entire network have fallen from £4 to £1.90 for every £1 spent.
But even these figures are suspect – key assumptions on demand, pricing, financing costs and other savings have been manipulated to exaggerate the case for HS2.
The Secretary of State for Transport, the Prime Minister and the vested interests pushing HS2 insist a new line is required to provide additional long distance rail capacity. They claim that without HS2 our railways will become “full”.
But the facts are different. The West Coast Main Line is one of our least crowded mainline services and most of its trains have just been lengthened to provide even more seats. Even the most aggressive forecasts for future demand can be met by improving existing lines and worst of all, HS2 does little to address the real problem of overcrowding on commuter lines in London, Birmingham, Leeds, Manchester and Glasgow.
HS2 will have a devastating impact on wildlife and some of our most precious landscapes and ecosystems. Over 130 protected wildlife sites are impacted by Phase 1 alone.
The new line would also increase carbon emissions – with official figures showing few passengers transferring from road (8%) or air (3%) to rail, and instead many new journeys being created.
Creating jobs is crucial to the British economy and its recovery – but HS2 is not the answer. Official figures confirm the project will create few jobs and those which are created will overwhelmingly be based in London.
The benefits for London are likely to be magnified given the route choice of HS2, which will not permit journeys between our great Northern cities. HS2 will not be an option for direct travel between Liverpool, Leeds, Manchester and Newcastle, but will instead encourage trips to London.
The scheme’s backers claim HS2 is a “done deal” – but this is far from correct. A broad coalition of economic, environmental and other groups, plus thousands of people who have come together as registered supporters of HS2AA, are fighting to make the case against HS2. To join us, sign up here.. Lead generation should be maintained as long as the business exists. You will have to be aggressive in the generation of leads. Take advantage of all opportunities when you meet people. Every person you meet or you receive an invitation from is an opportunity to increase lead generation.Sometimes, people do not seem to like the idea of network marketing because it requires being able to convince people to buy what they are offering. However, they do not have the confidence to face the client; much less convince him to buy the product. They are simply afraid of being rejected. But that is not the attitude one must take when doing a business such as this. You have to have the guts to do the marketing. If it does not work with one client, there are still many out there. There is no actual need to fear networking. When making contact with a client and the client declines your offer, this client can still help you. He or she may still be