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
7d6eb896
Commit
7d6eb896
authored
Nov 24, 2015
by
Dave Methvin
Committed by
Sam Saccone
Nov 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typescript-angular: Remove intermediate files
parent
24f362e2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
180 deletions
+0
-180
examples/typescript-angular/js/_all.js
examples/typescript-angular/js/_all.js
+0
-0
examples/typescript-angular/js/controllers/TodoCtrl.js
examples/typescript-angular/js/controllers/TodoCtrl.js
+0
-97
examples/typescript-angular/js/directives/TodoBlur.js
examples/typescript-angular/js/directives/TodoBlur.js
+0
-19
examples/typescript-angular/js/directives/TodoFocus.js
examples/typescript-angular/js/directives/TodoFocus.js
+0
-25
examples/typescript-angular/js/interfaces/ITodoScope.js
examples/typescript-angular/js/interfaces/ITodoScope.js
+0
-1
examples/typescript-angular/js/interfaces/ITodoStorage.js
examples/typescript-angular/js/interfaces/ITodoStorage.js
+0
-1
examples/typescript-angular/js/models/TodoItem.js
examples/typescript-angular/js/models/TodoItem.js
+0
-14
examples/typescript-angular/js/services/TodoStorage.js
examples/typescript-angular/js/services/TodoStorage.js
+0
-23
No files found.
examples/typescript-angular/js/_all.js
deleted
100644 → 0
View file @
24f362e2
examples/typescript-angular/js/controllers/TodoCtrl.js
deleted
100644 → 0
View file @
24f362e2
/// <reference path='../_all.ts' />
var
todos
;
(
function
(
todos
)
{
'
use strict
'
;
/**
* The main controller for the app. The controller:
* - retrieves and persists the model via the todoStorage service
* - exposes the model to the template and provides event handlers
*/
var
TodoCtrl
=
(
function
()
{
// dependencies are injected via AngularJS $injector
// controller's name is registered in Application.ts and specified from ng-controller attribute in index.html
function
TodoCtrl
(
$scope
,
$location
,
todoStorage
,
filterFilter
)
{
var
_this
=
this
;
this
.
$scope
=
$scope
;
this
.
$location
=
$location
;
this
.
todoStorage
=
todoStorage
;
this
.
filterFilter
=
filterFilter
;
this
.
todos
=
$scope
.
todos
=
todoStorage
.
get
();
$scope
.
newTodo
=
''
;
$scope
.
editedTodo
=
null
;
// 'vm' stands for 'view model'. We're adding a reference to the controller to the scope
// for its methods to be accessible from view / HTML
$scope
.
vm
=
this
;
// watching for events/changes in scope, which are caused by view/user input
// if you subscribe to scope or event with lifetime longer than this controller, make sure you unsubscribe.
$scope
.
$watch
(
'
todos
'
,
function
()
{
return
_this
.
onTodos
();
},
true
);
$scope
.
$watch
(
'
location.path()
'
,
function
(
path
)
{
return
_this
.
onPath
(
path
);
});
if
(
$location
.
path
()
===
''
)
$location
.
path
(
'
/
'
);
$scope
.
location
=
$location
;
}
TodoCtrl
.
prototype
.
onPath
=
function
(
path
)
{
this
.
$scope
.
statusFilter
=
(
path
===
'
/active
'
)
?
{
completed
:
false
}
:
(
path
===
'
/completed
'
)
?
{
completed
:
true
}
:
null
;
};
TodoCtrl
.
prototype
.
onTodos
=
function
()
{
this
.
$scope
.
remainingCount
=
this
.
filterFilter
(
this
.
todos
,
{
completed
:
false
}).
length
;
this
.
$scope
.
doneCount
=
this
.
todos
.
length
-
this
.
$scope
.
remainingCount
;
this
.
$scope
.
allChecked
=
!
this
.
$scope
.
remainingCount
;
this
.
todoStorage
.
put
(
this
.
todos
);
};
TodoCtrl
.
prototype
.
addTodo
=
function
()
{
if
(
!
this
.
$scope
.
newTodo
.
length
)
{
return
;
}
this
.
todos
.
push
(
new
todos
.
TodoItem
(
this
.
$scope
.
newTodo
,
false
));
this
.
$scope
.
newTodo
=
''
;
};
TodoCtrl
.
prototype
.
editTodo
=
function
(
todoItem
)
{
this
.
$scope
.
editedTodo
=
todoItem
;
};
TodoCtrl
.
prototype
.
doneEditing
=
function
(
todoItem
)
{
this
.
$scope
.
editedTodo
=
null
;
if
(
!
todoItem
.
title
)
{
this
.
removeTodo
(
todoItem
);
}
};
TodoCtrl
.
prototype
.
removeTodo
=
function
(
todoItem
)
{
this
.
todos
.
splice
(
this
.
todos
.
indexOf
(
todoItem
),
1
);
};
TodoCtrl
.
prototype
.
clearDoneTodos
=
function
()
{
this
.
$scope
.
todos
=
this
.
todos
=
this
.
todos
.
filter
(
function
(
todoItem
)
{
return
!
todoItem
.
completed
;
});
};
TodoCtrl
.
prototype
.
markAll
=
function
(
completed
)
{
this
.
todos
.
forEach
(
function
(
todoItem
)
{
todoItem
.
completed
=
completed
;
});
};
TodoCtrl
.
$inject
=
[
'
$scope
'
,
'
$location
'
,
'
todoStorage
'
,
'
filterFilter
'
];
return
TodoCtrl
;
})();
todos
.
TodoCtrl
=
TodoCtrl
;
})(
todos
||
(
todos
=
{}));
examples/typescript-angular/js/directives/TodoBlur.js
deleted
100644 → 0
View file @
24f362e2
/// <reference path='../_all.ts' />
var
todos
;
(
function
(
todos
)
{
'
use strict
'
;
/**
* Directive that executes an expression when the element it is applied to loses focus.
*/
function
todoBlur
()
{
return
{
link
:
function
(
$scope
,
element
,
attributes
)
{
element
.
bind
(
'
blur
'
,
function
()
{
$scope
.
$apply
(
attributes
.
todoBlur
);
});
}
};
}
todos
.
todoBlur
=
todoBlur
;
})(
todos
||
(
todos
=
{}));
examples/typescript-angular/js/directives/TodoFocus.js
deleted
100644 → 0
View file @
24f362e2
/// <reference path='../_all.ts' />
var
todos
;
(
function
(
todos
)
{
'
use strict
'
;
/**
* Directive that places focus on the element it is applied to when the expression it binds to evaluates to true.
*/
function
todoFocus
(
$timeout
)
{
return
{
link
:
function
(
$scope
,
element
,
attributes
)
{
$scope
.
$watch
(
attributes
.
todoFocus
,
function
(
newval
)
{
if
(
newval
)
{
$timeout
(
function
()
{
return
element
[
0
].
focus
();
},
0
,
false
);
}
});
}
};
}
todos
.
todoFocus
=
todoFocus
;
todoFocus
.
$inject
=
[
'
$timeout
'
];
})(
todos
||
(
todos
=
{}));
examples/typescript-angular/js/interfaces/ITodoScope.js
deleted
100644 → 0
View file @
24f362e2
/// <reference path='../_all.ts' />
examples/typescript-angular/js/interfaces/ITodoStorage.js
deleted
100644 → 0
View file @
24f362e2
/// <reference path='../_all.ts' />
examples/typescript-angular/js/models/TodoItem.js
deleted
100644 → 0
View file @
24f362e2
/// <reference path='../_all.ts' />
var
todos
;
(
function
(
todos
)
{
'
use strict
'
;
var
TodoItem
=
(
function
()
{
function
TodoItem
(
title
,
completed
)
{
this
.
title
=
title
;
this
.
completed
=
completed
;
}
return
TodoItem
;
})();
todos
.
TodoItem
=
TodoItem
;
})(
todos
||
(
todos
=
{}));
examples/typescript-angular/js/services/TodoStorage.js
deleted
100644 → 0
View file @
24f362e2
/// <reference path='../_all.ts' />
var
todos
;
(
function
(
todos
)
{
'
use strict
'
;
/**
* Services that persists and retrieves TODOs from localStorage.
*/
var
TodoStorage
=
(
function
()
{
function
TodoStorage
()
{
this
.
STORAGE_ID
=
'
todos-angularjs-typescript
'
;
}
TodoStorage
.
prototype
.
get
=
function
()
{
return
JSON
.
parse
(
localStorage
.
getItem
(
this
.
STORAGE_ID
)
||
'
[]
'
);
};
TodoStorage
.
prototype
.
put
=
function
(
todos
)
{
localStorage
.
setItem
(
this
.
STORAGE_ID
,
JSON
.
stringify
(
todos
));
};
return
TodoStorage
;
})();
todos
.
TodoStorage
=
TodoStorage
;
})(
todos
||
(
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