Skip to content

Commit

Permalink
sending filter parameter via shared shell
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavgujjar committed Aug 9, 2013
1 parent 33fd5cf commit 4f655ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion labs/dependency-examples/durandal/js/viewmodels/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ define([

self.activate = function () {
//initialize the show mode
self.showMode(shell.filter);
var filter = shell.filter;

if ( filter === undefined){
filter = 'all';
}

self.showMode(filter);

// // check local storage for todos
var todosFromlocalStorage = ko.utils.parseJson(localStorage.getItem('todos-durandal'));
Expand Down
2 changes: 1 addition & 1 deletion labs/dependency-examples/durandal/js/viewmodels/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define([

return {
router: router,
filter: '', // this is used as the global cache to figure out the filter in effect.
filter: undefined, // this is used as the global cache to figure out the filter in effect.
activate: function () {
return router.activate('todoapp');
}
Expand Down

0 comments on commit 4f655ec

Please sign in to comment.