Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
todomvc
Commits
705154dc
Commit
705154dc
authored
Mar 09, 2013
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Knockout app - code style
parent
c14b3976
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
architecture-examples/knockoutjs/js/app.js
architecture-examples/knockoutjs/js/app.js
+4
-4
No files found.
architecture-examples/knockoutjs/js/app.js
View file @
705154dc
...
...
@@ -151,20 +151,20 @@
// internal computed observable that fires whenever anything changes in our todos
ko
.
computed
(
function
()
{
// store a clean copy to local storage, which also creates a dependency on the observableArray and all observables in each item
localStorage
.
setItem
(
'
todos-knockout
'
,
ko
.
toJSON
(
self
.
todos
));
localStorage
.
setItem
(
'
todos-knockout
js
'
,
ko
.
toJSON
(
self
.
todos
));
}).
extend
({
throttle
:
500
});
// save at most twice per second
};
// check local storage for todos
var
todos
=
ko
.
utils
.
parseJson
(
localStorage
.
getItem
(
'
todos-knockout
'
));
var
todos
=
ko
.
utils
.
parseJson
(
localStorage
.
getItem
(
'
todos-knockout
js
'
));
// bind a new instance of our view model to the page
var
viewModel
=
new
ViewModel
(
todos
||
[]);
ko
.
applyBindings
(
viewModel
);
// set up filter routing
/*jshint newcap:false*/
/*jshint newcap:false
*/
Router
({
'
/:filter
'
:
viewModel
.
showMode
}).
init
();
}
()
);
}
)(
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment