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
7496c95e
Commit
7496c95e
authored
Feb 29, 2012
by
Christoph Burgdorf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added todo counter
parent
35636594
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
architecture-examples/angularjs/css/overwrite.css
architecture-examples/angularjs/css/overwrite.css
+9
-0
architecture-examples/angularjs/index_new.html
architecture-examples/angularjs/index_new.html
+2
-2
architecture-examples/angularjs/js/controllers.js
architecture-examples/angularjs/js/controllers.js
+9
-1
No files found.
architecture-examples/angularjs/css/overwrite.css
View file @
7496c95e
/*overwrite this as its getting in the angular way */
#main
{
display
:
block
;
}
#todoapp
footer
{
display
:
block
;
}
/*this doesn't seemed to be used in the jquery example at all. Its getting in the way */
#todo-count
span
{
font-weight
:
inherit
;
}
\ No newline at end of file
architecture-examples/angularjs/index_new.html
View file @
7496c95e
...
...
@@ -31,9 +31,9 @@
</li>
</ul>
</section>
<footer>
<footer
ng:show=
"hasTodos()"
>
<a
id=
"clear-completed"
>
Clear completed
</a>
<div
id=
"todo-count"
></div>
<div
id=
"todo-count"
><
b>
{{ remainingTodos() }}
</b>
{{ itemsLeftText() }}
<
/div>
</footer>
</div>
<div
id=
"instructions"
>
...
...
architecture-examples/angularjs/js/controllers.js
View file @
7496c95e
...
...
@@ -7,7 +7,7 @@ App.Controllers.TodoController = function () {
self
.
addTodo
=
function
()
{
if
(
self
.
newTodo
.
length
===
0
)
return
;
self
.
todos
.
push
({
content
:
self
.
newTodo
,
done
:
false
,
...
...
@@ -42,10 +42,18 @@ App.Controllers.TodoController = function () {
}
};
var
pluralize
=
function
(
count
,
word
)
{
return
count
===
1
?
word
:
word
+
'
s
'
;
}
self
.
remainingTodos
=
countTodos
(
"
undone
"
);
self
.
finishedTodos
=
countTodos
(
"
done
"
);
self
.
itemsLeftText
=
function
(){
return
pluralize
(
self
.
remainingTodos
(),
'
item
'
)
+
'
left
'
};
self
.
clearCompletedItems
=
function
()
{
var
oldTodos
=
self
.
todos
;
self
.
todos
=
[];
...
...
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