diff --git a/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md b/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md index cfea04e2e5c..d49f316fcdf 100644 --- a/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md +++ b/docs/can-guides/commitment/recipes/weather-report/weather-report-advanced.md @@ -25,7 +25,6 @@ The following sections are broken down into: - Things to know — Information about CanJS that is useful for solving the problem. - Solution — The solution to the problem. - ## Removing Imperative Code ### The problem @@ -232,14 +231,14 @@ We want to define the behavior of `place` so that it becomes `null` when `locati ### The solution -Update the `JS` tab to: +Update the __JavaScript__ tab to: - - Mixin [can-define-stream-kefir] into the `WeatherViewModel`. - - Remove the setter side-effects from `location` - - Change `place` to derive its value from: +1. Remove the setter side-effects from `location`. +2. Change `place` to derive its value from: - changes in `location` - `place` should be `null` if `location` changes. - the `.places` value - `place` should be the one and only _place_ in `places` if there is only one _place_ in `places`. - the set `.place` value. +3. Mix [can-define-stream-kefir] into the `WeatherViewModel`. @sourceref ./advanced-1/js.js @highlight 4,35-52,79,only @@ -359,9 +358,13 @@ We will do this by: ### The solution +Update the __JavaScript__ tab: + @sourceref ./advanced-2/js.js @highlight 3-21,24-40,only +Update the __HTML__ tab: + @sourceref ./advanced-2/html.html @highlight 1-3,only @@ -397,6 +400,8 @@ fetch("https://api.flickr.com/services/rest/?"+ ### The solution +Update the __JavaScript__ tab: + @sourceref ./advanced-3/js.js @highlight 41-60,108,only @@ -413,9 +418,13 @@ Display the message while `geoLocation` and `geoLocationError` are undefined. ### The solution +Update the __JavaScript__ tab: + @sourceref ./4-enable-location.js @highlight 61-63,only +Update the __HTML__ tab: + @sourceref ./4-enable-location.html @highlight 6-10,only @@ -428,13 +437,17 @@ Show the location entry `