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
df296b9c
Commit
df296b9c
authored
Jun 19, 2012
by
Stas SUȘCOV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use latest ember.js, add basic routing support.
parent
428dc1ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
17 deletions
+52
-17
dependency-examples/emberjs_require/js/app.js
dependency-examples/emberjs_require/js/app.js
+12
-17
dependency-examples/emberjs_require/js/app/router.js
dependency-examples/emberjs_require/js/app/router.js
+40
-0
No files found.
dependency-examples/emberjs_require/js/app.js
View file @
df296b9c
...
...
@@ -3,7 +3,8 @@ require.config({
baseUrl
:
'
js/
'
,
paths
:
{
jquery
:
'
../../../assets/jquery.min
'
,
ember
:
'
lib/ember-0.9.8.1.min
'
,
ember
:
'
http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.min
'
,
// ember: 'lib/ember-0.9.8.1.min',
text
:
'
lib/require/text
'
,
mocha
:
'
lib/mocha
'
,
chai
:
'
lib/chai
'
...
...
@@ -12,34 +13,28 @@ require.config({
// Load our app
define
(
'
app
'
,
[
'
jquery
'
,
'
app/router
'
,
'
app/models/store
'
,
'
app/controllers/todos
'
,
'
jquery
'
,
'
ember
'
,
],
function
(
$
,
Store
,
TodosController
)
{
],
function
(
Router
,
Store
,
TodosController
)
{
var
App
=
Ember
.
Application
.
create
({
VERSION
:
'
0.2
-omfg
'
,
VERSION
:
'
0.2
'
,
// Constructor
init
:
function
()
{
this
.
_super
();
// Initiate main controller
this
.
set
(
'
todosController
'
,
TodosController
.
create
({
store
:
new
Store
(
'
todos-emberjs
'
)
})
);
// Run specs if asked
if
(
location
.
hash
.
match
(
/specs/
)
)
{
require
(
[
'
app/specs/helper
'
]
);
}
this
.
set
(
'
todosController
'
,
TodosController
.
create
(
{
store
:
new
Store
(
'
todos-emberjs
'
)
}
)
);
}
});
// Initialize Application to load routes
App
.
Router
=
Router
;
App
.
initialize
();
// Expose the application globally
return
window
.
Todos
=
App
;
}
...
...
dependency-examples/emberjs_require/js/app/router.js
0 → 100644
View file @
df296b9c
define
(
'
app/router
'
,
[
'
ember
'
],
/**
* Todos Router
*
* Defined routes represent filters according to specs
*
* @returns Class
*/
function
(
ItemsView
,
StatsView
,
FiltersView
,
ClearBtnView
)
{
return
Ember
.
Router
.
extend
({
enableLogging
:
true
,
root
:
Ember
.
Route
.
extend
({
showAll
:
Ember
.
Route
.
transitionTo
(
'
index
'
),
showActive
:
Ember
.
Route
.
transitionTo
(
'
active
'
),
showCompleted
:
Ember
.
Route
.
transitionTo
(
'
completed
'
),
index
:
Ember
.
Route
.
extend
({
route
:
'
/
'
,
}),
active
:
Ember
.
Route
.
extend
({
route
:
'
/active
'
,
}),
completed
:
Ember
.
Route
.
extend
({
route
:
'
/completed
'
,
}),
specs
:
Ember
.
Route
.
extend
({
route
:
'
/specs
'
,
connectOutlets
:
function
()
{
require
(
[
'
app/specs/helper
'
]
);
}
})
})
});
}
);
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