.controller("TasksCtrl", function ($scope, tasksFactory) {
$scope.tasks = tasks;
$scope.addNew = function(task){
alert("Add new called!");
$scope.tasks.push(task);
};
$scope.remove = function(index){
$scope.tasks.splice(index, 1);
};
$scope.edit= function(task){
$scope.current = task;
};
$scope.save= function(task){
$scope.current = {};
};
})
Ich weiß also nicht, ob der Fehler in der Fabrik oder in meinem Controller istversuchen, ein Array bereits ausgefüllt zurück, aber es gibt eine leere Tabelle
**.factory('tasksFactory', function(){
var tasks = [
{ info: "Finish with the sales report for July", date:Date("October 13 ,2014 11:13:00"), hoursplanned:140, hoursworked:166 },
{ info: "Finish with the sales report for July", date:Date("October 13 ,2014 11:13:00"), hoursplanned:140, hoursworked:166 },
{ info: "Finish with the sales report for July", date:Date("October 13 ,2014 11:13:00"), hoursplanned:140, hoursworked:166 },
{ info: "Finish with the sales report for July", date:Date("October 13 ,2014 11:13:00"), hoursplanned:140, hoursworked:166 },
{ info: "Finish with the sales report for July", date:Date("October 13 ,2014 11:13:00"), hoursplanned:140, hoursworked:166 },
];
return tasks;
Was ist die Frage? – jlew