Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
Created October 9, 2013 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipedrazas/6903547 to your computer and use it in GitHub Desktop.
Save ipedrazas/6903547 to your computer and use it in GitHub Desktop.
'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