Created
October 9, 2013 15:57
-
-
Save ipedrazas/6903547 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
function log(entry){ | |
if( console && console.log ) { | |
console.log(entry); | |
} | |
} | |
angular.module('EmaServerMarksApp').factory('data', function(){ | |
var items = []; | |
return{ | |
setItem: function(item){ | |
items.push(item); | |
}, | |
getItems: function(){ | |
return items; | |
} | |
} | |
}); | |
angular.module('EmaServerMarksApp') | |
.controller('EntryController', function ($scope, data) { | |
$scope.items = data.getItems(); | |
$scope.addItem = function (item) { | |
data.setItem(item); | |
$scope.item = ""; | |
}; | |
}); | |
angular.module('EmaServerMarksApp') | |
.controller('HookController', function ($scope, data) { | |
$scope.items = data.getItems(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment