Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Blazing fast Apple TV application development using pure JavaScript.
- [Custom options while navigation](#custom-options-while-navigation)
- [Creating Menu Page](#creating-menu-page)
- [Application initialization using configuration](#application-initialization-using-configuration)
- [Dynamic Page URLs](#dynamic-page-urls)
- [Sample Code](#sample-code)
- [Useful Links](#useful-links)
- [Contributions](#contributions)
Expand Down Expand Up @@ -430,6 +431,25 @@ ATV.start({
});
```

<a name="dynamic-page-urls"></a>
#### Dynamic Page URLs

You can use express-style path-variables in `url`. The example below will resolve `:param` with `"value"`.
**Note that all defined parameters (i.e. every string in the `url` starting with a `:`) must be set in `urlParams`!**

```javascript
ATV.Page.create({
name: 'home',
url: 'path/to/your/api/that/returns/json?param=:param',
template: your_template_function
});
```
```
<button data-href-page="login" data-href-page-options='{"urlParams": {"param": "value"}}'>
<text>Login</text>
</button>
```

<a name="sample-code"></a>
### Sample Code
You can find a port of the original TVML Catalog sample code [re-written using atvjs](https://github.com/emadalam/tvml-catalog-using-atvjs).
Expand Down
Loading