From 2f222dcb89927bfd213788f21836d54b0cce4ebc Mon Sep 17 00:00:00 2001 From: Pat Cavit Date: Thu, 12 Jan 2017 12:34:52 -0800 Subject: [PATCH] docs: Document m.route.param() survival As revived in #1532 --- docs/change-log.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/change-log.md b/docs/change-log.md index 2652b700..988ec9d2 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -400,13 +400,16 @@ m.route.set("/other/route") ## Accessing route params -In `v0.2.x` reading route params was all handled through the `m.route.param()` method. In `v1.x` any route params are passed as the `attrs` object on the vnode passed as the first argument to lifecycle methods/`view`. +In `v0.2.x` reading route params was entirely handled through `m.route.param()`. This API is still available in `v1.x`, and additionally any route params are passed as properties in the `attrs` object on the vnode. ### `v0.2.x` ```javascript m.route(document.body, "/booga", { "/:attr" : { + controller : function() { + m.route.param("attr") // "booga" + }, view : function() { m.route.param("attr") // "booga" } @@ -421,9 +424,11 @@ m.route(document.body, "/booga", { "/:attr" : { oninit : function(vnode) { vnode.attrs.attr // "booga" + m.route.param("attr") // "booga" }, view : function(vnode) { vnode.attrs.attr // "booga" + m.route.param("attr") // "booga" } } })