Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
define(function (require) {
var san = require('san');
var service = require('../service');
var template = require('tpl!./List.html');
return san.defineComponent({
template: template,
filters: {
formatDate: require('../filters').formatDate
},
components: {
'router-link': require('san-router').Link
},
route: function () {
var route = this.data.get('route');
var todos = service.todos(+(route.query.category || 0));
this.data.set('todos', todos);
if (!this.data.get('categories')) {
this.data.set('categories', service.categories());
}
},
doneTodo: function (index) {
var todo = this.data.get('todos', index);
service.doneTodo(todo.id);
define(function (require) {
var san = require('san');
var service = require('../service-perf');
var template = require('tpl!./List.html');
return san.defineComponent({
template: template,
components: {
'router-link': require('san-router').Link
},
filters: {
formatDate: require('../filters').formatDate
},
route: function () {
var now = new Date();
var route = this.data.get('route');
var todos = service.todos(+(route.query.category || 0));
this.data.set('todos', todos);
if (!this.data.get('categories')) {
this.data.set('categories', service.categories());
}