Question: I am using the directive to validate the mobile number input

```
import { Directive, ElementRef, HostListener, Input } from '@angular/core';

@Directive({
  selector: '[mobileNumber]'
})
export class MobileNumberDirective {

  @Input()
  public value: any;

  constructor(private el: ElementRef) { }

  @HostListener('keypress', ['$event'])
    onKeyDown(event: KeyboardEvent) {

        var inp = String.fromCharCode(event.keyCode);
        if (/[0-9]/.test(inp)) {
            return true;
        } else {
            if (event.keyCode == 8 || (event.keyCode == 43 && this.value == '')) {
                return true;
            } else {
                event.preventDefault();
                return false;
            }
        }
    }

}

```

The input field is this :

```
<input
       type="text"
       placeholder="Search Mobile"
       autocomplete="off"
       [value]="'1111199999'"
       mobileNumber
/>

```

here, the [value] is not working when the directive is applied but working fine without it.

Answer: 
The `{{#each patient}}` in your template anticipates that the data that you pass to your template function has a property named `patient` and that the value of this property is iterable - like an Array.

However, it appears that you are simply passing an Array directly to your template function, and that Array does not have a `patient` property, and so the `#each` loop never executes.

One way to make this work would be to pass an Object to your template function and to assign to that Object a key, `patient`, with its value being your Array of patients.

This would require changing:

```
let patientSearchResultTemplateObject = patientSearchResultTemplateFunction(patient);

```

to:

```
let patientSearchResultTemplateObject = patientSearchResultTemplateFunction({ patient: patient });

```

Or use the shorthand:

```
let patientSearchResultTemplateObject = patientSearchResultTemplateFunction({ patient });

```

Note: As `patient` is an Array of Patient Objects, if I were on your team, I would urge you to add an "s" to its name to make it plural.
Ultimately, the problem was that the data was seen Handlebars as a Sequelizer Object. It was unable to access the prototype due to a security update in Handlebars 4.6.0.

Rather than using "allowInsecurePrototypeAccess" which is a widely suggested fix but one that seems like unsound advice, I made a deep copy of the data by using JSON.stringify() and JSON.parse() and Handlebars was able to access it.

It was a context error, just not the one I was expecting.