I have my file structure in a sveltekit app like this:
src/routes/test/sample.svelte
<script>
export let message;
postId = 64;
</script>
<h1>{message}</h1>
src/routes/test/sample.ts
let postId;
export async function get() {
return {
body: {
message: 'Selected post id is : ' + postId ,
}
};
}
With this code we can get message from .ts file and show it in .svelte route;
How can I pass postId from sample.svelte into sample.ts ?