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
Eugene Shen
todomvc
Commits
8a023841
Commit
8a023841
authored
Dec 19, 2013
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #750 from jondalberg/gh-pages
batman.js - fix the index view to render contents correctly
parents
2a8f8423
1ac0775b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
labs/architecture-examples/batman/app.coffee
labs/architecture-examples/batman/app.coffee
+4
-1
labs/architecture-examples/batman/app.js
labs/architecture-examples/batman/app.js
+7
-1
No files found.
labs/architecture-examples/batman/app.coffee
View file @
8a023841
...
...
@@ -11,7 +11,7 @@ class Alfred.TodosController extends Batman.Controller
routingKey
:
'todos'
index
:
->
@
set
(
'currentTodoSet'
,
'
all
'
)
@
set
(
'currentTodoSet'
,
'
default
'
)
completed
:
->
@
set
'currentTodoSet'
,
'completed'
...
...
@@ -79,6 +79,9 @@ class Alfred.Todo extends Batman.Model
@
encode
'title'
,
'completed'
@
validate
'title'
,
presence
:
true
@
classAccessor
'default'
,
->
@
get
(
'all'
).
filter
(
todo
)
->
true
@
classAccessor
'active'
,
->
@
get
(
'all'
).
filter
(
todo
)
->
!
todo
.
get
(
'completed'
)
...
...
labs/architecture-examples/batman/app.js
View file @
8a023841
...
...
@@ -37,7 +37,7 @@
TodosController
.
prototype
.
routingKey
=
'
todos
'
;
TodosController
.
prototype
.
index
=
function
()
{
return
this
.
set
(
'
currentTodoSet
'
,
'
all
'
);
return
this
.
set
(
'
currentTodoSet
'
,
'
default
'
);
};
TodosController
.
prototype
.
completed
=
function
()
{
...
...
@@ -184,6 +184,12 @@
presence
:
true
});
Todo
.
classAccessor
(
'
default
'
,
function
()
{
return
this
.
get
(
'
all
'
).
filter
(
function
(
todo
)
{
return
true
;
});
});
Todo
.
classAccessor
(
'
active
'
,
function
()
{
return
this
.
get
(
'
all
'
).
filter
(
function
(
todo
)
{
return
!
todo
.
get
(
'
completed
'
);
...
...
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