Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding docs about href with params

  • Loading branch information...
commit a32703b071a2e9ff867110cd0c43125ec521617d 1 parent 586888e
@finnsson authored
View
1  pagerjs.com/demo/index.html
@@ -95,6 +95,7 @@
<div data-bind="page: {id: 'deep_navigation', title: 'Deep Navigation', desc: 'navigating into subpages of subpages', scrollToTop: true, sourceCache: true, sourceOnShow: 'page/deep_navigation.html'}"></div>
<div data-bind="page: {id: 'relative_path', title: 'Relative Path', desc: 'traversing the fragment identifier', scrollToTop: true, sourceCache: true, sourceOnShow: 'page/relative_path.html'}"></div>
<div data-bind="page: {id: 'absolute_path', title: 'Absolute Path', sourceOnShow: 'page/absolute_path.html', scrollToTop: true, sourceCache: true, desc: 'binding page-href to page-instance'}"></div>
+ <div data-bind="page: {id: 'href_with_params', title: 'Parameters in Path', sourceOnShow: 'page/href_with_params.html', scrollToTop: true, sourceCache: true, desc: 'add parameters to page-href'}"></div>
<div data-bind="page: {id: 'html5_history', title: 'HTML5 History', desc: 'you do not need to use fragment identifiers', scrollToTop: true, sourceCache: true, sourceOnShow: 'page/html5_history.html'}"></div>
<div data-bind="page: {id: 'matching_wildcards', title: 'Matching Wildcards', desc: 'pages that match any route', scrollToTop: true, sourceCache: true, sourceOnShow: 'page/matching_wildcards.html'}"></div>
View
41 pagerjs.com/demo/page/href_with_params.html
@@ -0,0 +1,41 @@
+<header class="jumbotron subhead">
+ <h1>Parameters in Path</h1>
+
+ <p class="lead">
+ You can supply the <code>page-href</code> binding with not only a path
+ but also parameters. This is done using the syntax <code>page-href: {path:,params:}</code>
+ where path can be a <code>String</code> or <code>Page</code> as normal and
+ params can be an object.
+ </p>
+</header>
+
+<a class="btn" data-bind="page-href: {path: 'user', params: {first: 'Philip', last: 'Fry'}}">Send parameter to page</a>
+
+<div data-bind="page: {id: 'user', params: ['first','last']}" class="well-small">
+ <div>
+ <span>First name:</span>
+ <span data-bind="text: first"></span>
+ </div>
+ <div>
+ <span>Last name:</span>
+ <span data-bind="text: last"></span>
+ </div>
+</div>
+
+
+<pre data-bind="prettyprint: {}" class="prettyprint linenums">
+&lt;a class="btn" data-bind="page-href: {path: 'user', params: {first: 'Philip', last: 'Fry'}}"&gt;Send parameter to page&lt;/a&gt;
+
+&lt;div data-bind="page: {id: 'user', params: ['first','last']}" class="well-small"&gt;
+ &lt;div&gt;
+ &lt;span&gt;First name:&lt;/span&gt;
+ &lt;span data-bind="text: first"&gt;&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;div&gt;
+ &lt;span&gt;Last name:&lt;/span&gt;
+ &lt;span data-bind="text: last"&gt;&lt;/span&gt;
+ &lt;/div&gt;
+&lt;/div&gt;
+</pre>
+
+<div data-bind="template: {name: 'link-template'}"></div>
Please sign in to comment.
Something went wrong with that request. Please try again.