Pass data using keyup.enter

i made a search bar in main.html like this.

<ion-searchbar #q [(ngModel)]="searchQuery" (keyup.enter)="gameName(q.value)"></ion-searchbar>

and this is my main.ts

gameName( q: string ) {

when i push the enter button, the new page(/menu/search) is open now.
i want to go to the new page with data ‘q’!!
how can i send the data with using this ‘gameName()’ function?