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
a960f9a4
Commit
a960f9a4
authored
Dec 22, 2015
by
dmitriz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
angularjs-perf: Remove global var todomvc
parent
fb0c821f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
10 deletions
+18
-10
examples/angularjs-perf/js/app.js
examples/angularjs-perf/js/app.js
+2
-2
examples/angularjs-perf/js/controllers/todoCtrl.js
examples/angularjs-perf/js/controllers/todoCtrl.js
+4
-2
examples/angularjs-perf/js/directives/todoEscape.js
examples/angularjs-perf/js/directives/todoEscape.js
+4
-2
examples/angularjs-perf/js/directives/todoFocus.js
examples/angularjs-perf/js/directives/todoFocus.js
+4
-2
examples/angularjs-perf/js/services/todoStorage.js
examples/angularjs-perf/js/services/todoStorage.js
+4
-2
No files found.
examples/angularjs-perf/js/app.js
View file @
a960f9a4
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
'
use strict
'
;
'
use strict
'
;
/**
/**
* The main TodoMVC app module
* The main TodoMVC app module
that pulls all dependency modules declared in same named files
*
*
* @type {angular.Module}
* @type {angular.Module}
*/
*/
var
todomvc
=
angular
.
module
(
'
todomvc
'
,
[
]);
angular
.
module
(
'
todomvc
'
,
[
'
todoCtrl
'
,
'
todoEscape
'
,
'
todoStorage
'
]);
examples/angularjs-perf/js/controllers/todoCtrl.js
View file @
a960f9a4
/*global
todomvc,
angular */
/*global angular */
'
use strict
'
;
'
use strict
'
;
angular
.
module
(
'
todoCtrl
'
,
[])
/**
/**
* The main controller for the app. The controller:
* The main controller for the app. The controller:
* - retrieves and persists the model via the todoStorage service
* - retrieves and persists the model via the todoStorage service
* - exposes the model to the template and provides event handlers
* - exposes the model to the template and provides event handlers
*/
*/
todomvc
.
controller
(
'
TodoCtrl
'
,
function
TodoCtrl
(
$scope
,
$location
,
$filter
,
todoStorage
)
{
.
controller
(
'
TodoCtrl
'
,
function
TodoCtrl
(
$scope
,
$location
,
$filter
,
todoStorage
)
{
var
todos
=
$scope
.
todos
=
todoStorage
.
get
();
var
todos
=
$scope
.
todos
=
todoStorage
.
get
();
$scope
.
newTodo
=
''
;
$scope
.
newTodo
=
''
;
...
...
examples/angularjs-perf/js/directives/todoEscape.js
View file @
a960f9a4
/*global
todomvc
*/
/*global
angular
*/
'
use strict
'
;
'
use strict
'
;
angular
.
module
(
'
todoEscape
'
,
[])
/**
/**
* Directive that executes an expression when the element it is applied to gets
* Directive that executes an expression when the element it is applied to gets
* an `escape` keydown event.
* an `escape` keydown event.
*/
*/
todomvc
.
directive
(
'
todoEscape
'
,
function
()
{
.
directive
(
'
todoEscape
'
,
function
()
{
var
ESCAPE_KEY
=
27
;
var
ESCAPE_KEY
=
27
;
return
function
(
scope
,
elem
,
attrs
)
{
return
function
(
scope
,
elem
,
attrs
)
{
elem
.
bind
(
'
keydown
'
,
function
(
event
)
{
elem
.
bind
(
'
keydown
'
,
function
(
event
)
{
...
...
examples/angularjs-perf/js/directives/todoFocus.js
View file @
a960f9a4
/*global
todomvc
*/
/*global
angular
*/
'
use strict
'
;
'
use strict
'
;
angular
.
module
(
'
todoFocus
'
,
[])
/**
/**
* Directive that places focus on the element it is applied to when the expression it binds to evaluates to true
* Directive that places focus on the element it is applied to when the expression it binds to evaluates to true
*/
*/
todomvc
.
directive
(
'
todoFocus
'
,
function
(
$timeout
)
{
.
directive
(
'
todoFocus
'
,
function
(
$timeout
)
{
return
function
(
scope
,
elem
,
attrs
)
{
return
function
(
scope
,
elem
,
attrs
)
{
scope
.
$watch
(
attrs
.
todoFocus
,
function
(
newVal
)
{
scope
.
$watch
(
attrs
.
todoFocus
,
function
(
newVal
)
{
if
(
newVal
)
{
if
(
newVal
)
{
...
...
examples/angularjs-perf/js/services/todoStorage.js
View file @
a960f9a4
/*global
todomvc
*/
/*global
angular
*/
'
use strict
'
;
'
use strict
'
;
angular
.
module
(
'
todoStorage
'
,
[])
/**
/**
* Services that persists and retrieves TODOs from localStorage
* Services that persists and retrieves TODOs from localStorage
*/
*/
todomvc
.
factory
(
'
todoStorage
'
,
function
()
{
.
factory
(
'
todoStorage
'
,
function
()
{
var
STORAGE_ID
=
'
todos-angularjs-perf
'
;
var
STORAGE_ID
=
'
todos-angularjs-perf
'
;
return
{
return
{
...
...
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