-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transition to show only incomplete todos
http://guides.emberjs.com/v1.10.0/getting-started/show-only-incomplete-todos/ ``` ember g route todos/active rm app/templates/todos/active.hbs ```
- Loading branch information
1 parent
da657eb
commit 9ba333f
Showing
4 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Route.extend({ | ||
model: function(){ | ||
return this.store.filter('todo', function(todo) { | ||
return !todo.get('isCompleted'); | ||
}); | ||
}, | ||
renderTemplate: function(controller) { | ||
this.render('todos/index', {controller: controller}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { | ||
moduleFor, | ||
test | ||
} from 'ember-qunit'; | ||
|
||
moduleFor('route:todos/active', { | ||
// Specify the other units that are required for this test. | ||
// needs: ['controller:foo'] | ||
}); | ||
|
||
test('it exists', function(assert) { | ||
var route = this.subject(); | ||
assert.ok(route); | ||
}); |