{I" class:ETI"ProcessedAsset;FI"logical_path;TI"8social_networking/controllers/profile-controller.js;FI" pathname;TI"y/Users/ems408/workspace/social_networking/app/assets/javascripts/social_networking/controllers/profile-controller.js;FI"content_type;TI"application/javascript;TI" mtime;Tl+æ#\TI" length;TiQI" digest;TI"%2ea9c902587e8c9462ef790d6b69dae8;FI" source;TI"Q;(function() { "use strict"; // Provide interaction with a participant's profile. function ProfileCtrl(profileId, Profiles, Nudges) { var self = this; self._profiles = Profiles; self._nudges = Nudges; self.profile = {}; self._profiles.getOne(profileId).then(function(profile) { self.id = profile.id; self.profile = profile; self.iconSrc = ''; }).catch(function(error) { window.console.log(error); }); } // Send a nudge from one participant to another. ProfileCtrl.prototype.nudge = function(recipient_id) { var self = this; this._nudges.create(recipient_id) .then(function() { self.nudgeAlert = "Nudge sent!"; }); }; // Update the profile icon ProfileCtrl.prototype.update_profile_icon = function(icon_name, controller) { controller.iconSrc = icon_name; controller._profiles.update(controller).then(function(profile) { controller.profile.iconSrc = profile.iconSrc; }); $('#icon-selection-button').click(); }; ProfileCtrl.prototype.getIconSrc = function(controller) { return controller.profile.iconSrc; }; // Create a module and register the controllers. angular.module('socialNetworking.controllers') .controller('ProfileCtrl', ['profileId', 'Profiles', 'Nudges', ProfileCtrl]); })(); ;TI"dependency_digest;TI"%1bcb345b13a4869cca517b7238e2d00c;FI"required_paths;T[I"y/Users/ems408/workspace/social_networking/app/assets/javascripts/social_networking/controllers/profile-controller.js;FI"dependency_paths;T[{I" path;TI"y/Users/ems408/workspace/social_networking/app/assets/javascripts/social_networking/controllers/profile-controller.js;F@I"2014-11-06T19:44:06-06:00;T@I"%2ea9c902587e8c9462ef790d6b69dae8;FI" _version;TI"%883b724e06f474a3db2deee10c127ab9;F