How can I pass in navigation function to search result item?

Hello guys,

I’m building an app with 20 different pages with completely information on each.
and the each page will get search feature to navigate to another page.
It may sounds odd but this works for what I’m building…
I have 20 different navigate functions for each of 20 pages in my typescript.

so I managed to build a a search bar with data provider which can search through the items below:

private homes: any[] = [
            "name": "New York City", 
            "zip": "01112",
            "rental": "yes",
            "navigate": "openNYC()",
            "id": "1"

            "name": "San Francisco", 
            "zip": "31112",
            "rental": "yes",
            "navigate": "openSF()",
            "id": "2"
            "name": "Boston", 
            "zip": "02112",
            "rental": "yes",
            "navigate": "openBOS()",
            "id": "3"

and so on....

I want users to navigate to each page when they tab on search result item.
How can I pass in this “navigate” function to search result item?
It allows me to search but I can’t make them navigate to a specific page.
I can pass in all other data but the function can’t be passed in like texts. How do you guys deal with this kind of problem?