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
5a2db4c0
Commit
5a2db4c0
authored
Jul 09, 2013
by
Addy Osmani
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #618 from snize/gh-pages
Fixing #617
parents
e149f24f
13d6a876
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
labs/architecture-examples/meteor/.meteor/packages
labs/architecture-examples/meteor/.meteor/packages
+1
-1
labs/architecture-examples/meteor/app.js
labs/architecture-examples/meteor/app.js
+34
-1
No files found.
labs/architecture-examples/meteor/.meteor/packages
View file @
5a2db4c0
autopublish
labs/architecture-examples/meteor/app.js
View file @
5a2db4c0
...
...
@@ -191,7 +191,40 @@ if (Meteor.is_client) {
// Register click events for clearing completed todos
Template
.
footer
.
events
=
{
'
click button#clear-completed
'
:
function
()
{
Todos
.
remove
({
completed
:
true
}
);
Meteor
.
call
(
'
clearCompleted
'
);
}
};
}
//Publish and subscribe setting
if
(
Meteor
.
is_server
)
{
Meteor
.
publish
(
'
todos
'
,
function
()
{
return
Todos
.
find
();
});
}
if
(
Meteor
.
is_client
)
{
Meteor
.
subscribe
(
'
todos
'
);
}
//Allow users to write directly to this collection from client code, subject to limitations you define.
if
(
Meteor
.
is_server
)
{
Todos
.
allow
({
insert
:
function
()
{
return
true
;
},
update
:
function
()
{
return
true
;
},
remove
:
function
()
{
return
true
;
}
});
}
//Defines functions that can be invoked over the network by clients.
Meteor
.
methods
({
clearCompleted
:
function
()
{
Todos
.
remove
({
completed
:
true
});
}
});
\ No newline at end of file
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