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
60c78081
Commit
60c78081
authored
Dec 22, 2015
by
Colin Eberhardt
Committed by
Sam Saccone
Jan 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved to a more conventional angular 2 structure - seperated bootstrap
parent
45e94d1d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
85 additions
and
8 deletions
+85
-8
examples/angular2/app/app.html
examples/angular2/app/app.html
+23
-0
examples/angular2/app/app.js
examples/angular2/app/app.js
+3
-3
examples/angular2/app/app.ts
examples/angular2/app/app.ts
+49
-0
examples/angular2/app/bootstrap.js
examples/angular2/app/bootstrap.js
+4
-0
examples/angular2/app/bootstrap.ts
examples/angular2/app/bootstrap.ts
+4
-0
examples/angular2/app/services/store.js
examples/angular2/app/services/store.js
+0
-0
examples/angular2/app/services/store.ts
examples/angular2/app/services/store.ts
+0
-0
examples/angular2/index.html
examples/angular2/index.html
+1
-4
examples/angular2/tsconfig.json
examples/angular2/tsconfig.json
+1
-1
No files found.
examples/angular2/app/app.html
0 → 100644
View file @
60c78081
<section
class=
"todoapp"
>
<header
class=
"header"
>
<h1>
todos
</h1>
<input
class=
"new-todo"
placeholder=
"What needs to be done?"
autofocus=
""
#newtodo
(keyup)=
"addTodo($event, newtodo)"
>
</header>
<section
class=
"main"
*ngIf=
"todoStore.todos.length > 0"
>
<input
class=
"toggle-all"
type=
"checkbox"
*ngIf=
"todoStore.todos.length"
#toggleall
[checked]=
"todoStore.allCompleted()"
(click)=
"todoStore.setAllTo(toggleall)"
>
<ul
class=
"todo-list"
>
<li
*ngFor=
"#todo of todoStore.todos"
[class.completed]=
"todo.completed"
[class.editing]=
"todo.editing"
>
<div
class=
"view"
>
<input
class=
"toggle"
type=
"checkbox"
(click)=
"toggleCompletion(todo)"
[checked]=
"todo.completed"
>
<label
(dblclick)=
"editTodo(todo)"
>
{{todo.title}}
</label>
<button
class=
"destroy"
(click)=
"remove(todo)"
></button>
</div>
<input
class=
"edit"
*ngIf=
"todo.editing"
[value]=
"todo.title"
#editedtodo
(blur)=
"stopEditing(todo, editedtodo)"
(keyup.enter)=
"updateEditingTodo(editedtodo, todo)"
(keyup.escape)=
"cancelEditingTodo(todo)"
>
</li>
</ul>
</section>
<footer
class=
"footer"
*ngIf=
"todoStore.todos.length > 0"
>
<span
class=
"todo-count"
><strong>
{{todoStore.getRemaining().length}}
</strong>
{{todoStore.getRemaining().length == 1 ? 'item' : 'items'}} left
</span>
<button
class=
"clear-completed"
*ngIf=
"todoStore.getCompleted().length > 0"
(click)=
"removeCompleted()"
>
Clear completed
</button>
</footer>
</section>
examples/angular2/app.js
→
examples/angular2/app
/app
.js
View file @
60c78081
...
...
@@ -8,7 +8,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
metadata
===
"
function
"
)
return
Reflect
.
metadata
(
k
,
v
);
};
var
core_1
=
require
(
'
angular2/core
'
);
var
browser_1
=
require
(
'
angular2/platform/browser
'
);
var
store_1
=
require
(
'
./services/store
'
);
var
ESC_KEY
=
27
;
var
ENTER_KEY
=
13
;
...
...
@@ -50,11 +49,12 @@ var TodoApp = (function () {
TodoApp
=
__decorate
([
core_1
.
Component
({
selector
:
'
todo-app
'
,
template
:
"
\n\t\t
<section class=
\"
todoapp
\"
>
\n\t\t\t
<header class=
\"
header
\"
>
\n\t\t\t\t
<h1>todos</h1>
\n\t\t\t\t
<input class=
\"
new-todo
\"
placeholder=
\"
What needs to be done?
\"
autofocus=
\"\"
#newtodo (keyup)=
\"
addTodo($event, newtodo)
\"
>
\n\t\t\t
</header>
\n\t\t\t
<section class=
\"
main
\"
*ngIf=
\"
todoStore.todos.length > 0
\"
>
\n\t\t\t\t
<input class=
\"
toggle-all
\"
type=
\"
checkbox
\"
*ngIf=
\"
todoStore.todos.length
\"
#toggleall [checked]=
\"
todoStore.allCompleted()
\"
(click)=
\"
todoStore.setAllTo(toggleall)
\"
>
\n\t\t\t\t
<ul class=
\"
todo-list
\"
>
\n\t\t\t\t\t
<li *ngFor=
\"
#todo of todoStore.todos
\"
[class.completed]=
\"
todo.completed
\"
[class.editing]=
\"
todo.editing
\"
>
\n\t\t\t\t\t\t
<div class=
\"
view
\"
>
\n\t\t\t\t\t\t\t
<input class=
\"
toggle
\"
type=
\"
checkbox
\"
(click)=
\"
toggleCompletion(todo)
\"
[checked]=
\"
todo.completed
\"
>
\n\t\t\t\t\t\t\t
<label (dblclick)=
\"
editTodo(todo)
\"
>{{todo.title}}</label>
\n\t\t\t\t\t\t\t
<button class=
\"
destroy
\"
(click)=
\"
remove(todo)
\"
></button>
\n\t\t\t\t\t\t
</div>
\n\t\t\t\t\t\t
<input class=
\"
edit
\"
*ngIf=
\"
todo.editing
\"
[value]=
\"
todo.title
\"
#editedtodo (blur)=
\"
stopEditing(todo, editedtodo)
\"
(keyup.enter)=
\"
updateEditingTodo(editedtodo, todo)
\"
(keyup.escape)=
\"
cancelEditingTodo(todo)
\"
>
\n\t\t\t\t\t
</li>
\n\t\t\t\t
</ul>
\n\t\t\t
</section>
\n\t\t\t
<footer class=
\"
footer
\"
*ngIf=
\"
todoStore.todos.length > 0
\"
>
\n\t\t\t\t
<span class=
\"
todo-count
\"
><strong>{{todoStore.getRemaining().length}}</strong> {{todoStore.getRemaining().length == 1 ? 'item' : 'items'}} left</span>
\n\t\t\t\t
<button class=
\"
clear-completed
\"
*ngIf=
\"
todoStore.getCompleted().length > 0
\"
(click)=
\"
removeCompleted()
\"
>Clear completed</button>
\n\t\t\t
</footer>
\n\t\t
</section>
"
template
Url
:
'
app/app.html
'
}),
__metadata
(
'
design:paramtypes
'
,
[])
],
TodoApp
);
return
TodoApp
;
})();
browser_1
.
bootstrap
(
TodoApp
);
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
default
=
TodoApp
;
//# sourceMappingURL=app.js.map
\ No newline at end of file
examples/angular2/app.ts
→
examples/angular2/app
/app
.ts
View file @
60c78081
import
{
Component
}
from
'
angular2/core
'
;
import
{
bootstrap
}
from
'
angular2/platform/browser
'
;
import
{
TodoStore
,
Todo
}
from
'
./services/store
'
;
const
ESC_KEY
=
27
;
...
...
@@ -7,32 +6,9 @@ const ENTER_KEY = 13;
@
Component
({
selector
:
'
todo-app
'
,
template
:
`
<section class="todoapp">
<header class="header">
<h1>todos</h1>
<input class="new-todo" placeholder="What needs to be done?" autofocus="" #newtodo (keyup)="addTodo($event, newtodo)">
</header>
<section class="main" *ngIf="todoStore.todos.length > 0">
<input class="toggle-all" type="checkbox" *ngIf="todoStore.todos.length" #toggleall [checked]="todoStore.allCompleted()" (click)="todoStore.setAllTo(toggleall)">
<ul class="todo-list">
<li *ngFor="#todo of todoStore.todos" [class.completed]="todo.completed" [class.editing]="todo.editing">
<div class="view">
<input class="toggle" type="checkbox" (click)="toggleCompletion(todo)" [checked]="todo.completed">
<label (dblclick)="editTodo(todo)">{{todo.title}}</label>
<button class="destroy" (click)="remove(todo)"></button>
</div>
<input class="edit" *ngIf="todo.editing" [value]="todo.title" #editedtodo (blur)="stopEditing(todo, editedtodo)" (keyup.enter)="updateEditingTodo(editedtodo, todo)" (keyup.escape)="cancelEditingTodo(todo)">
</li>
</ul>
</section>
<footer class="footer" *ngIf="todoStore.todos.length > 0">
<span class="todo-count"><strong>{{todoStore.getRemaining().length}}</strong> {{todoStore.getRemaining().length == 1 ? 'item' : 'items'}} left</span>
<button class="clear-completed" *ngIf="todoStore.getCompleted().length > 0" (click)="removeCompleted()">Clear completed</button>
</footer>
</section>`
templateUrl
:
'
app/app.html
'
})
class
TodoApp
{
export
default
class
TodoApp
{
todoStore
:
TodoStore
;
constructor
()
{
this
.
todoStore
=
new
TodoStore
();
...
...
@@ -71,5 +47,3 @@ class TodoApp {
}
}
}
bootstrap
(
TodoApp
);
examples/angular2/app/bootstrap.js
0 → 100644
View file @
60c78081
var
browser_1
=
require
(
'
angular2/platform/browser
'
);
var
app_1
=
require
(
'
./app
'
);
browser_1
.
bootstrap
(
app_1
.
default
);
//# sourceMappingURL=bootstrap.js.map
\ No newline at end of file
examples/angular2/app/bootstrap.ts
0 → 100644
View file @
60c78081
import
{
bootstrap
}
from
'
angular2/platform/browser
'
;
import
TodoApp
from
'
./app
'
bootstrap
(
TodoApp
);
examples/angular2/services/store.js
→
examples/angular2/
app/
services/store.js
View file @
60c78081
File moved
examples/angular2/services/store.ts
→
examples/angular2/
app/
services/store.ts
View file @
60c78081
File moved
examples/angular2/index.html
View file @
60c78081
...
...
@@ -27,12 +27,9 @@
format
:
'
cjs
'
,
defaultExtension
:
'
js
'
}
},
map
:
{
'
app
'
:
'
./
'
}
});
System
.
import
(
'
app/
ap
p
'
);
System
.
import
(
'
app/
bootstra
p
'
);
</script>
</body>
</html>
examples/angular2/tsconfig.json
View file @
60c78081
...
...
@@ -10,6 +10,6 @@
"noImplicitAny"
:
false
},
"files"
:
[
"app.ts"
"app
/bootstrap
.ts"
]
}
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