var myApp = angular.module('myApp', []);
// make a factory to share data between controllers
myApp.factory('Data', function(){
var data = {
firstName: ''
};
return {
getFirstName: function () {
return data.firstName;
},
setFirstName: function (firstName) {
data.firstName = firstName;
}
};
});