'use strict';

/*
 * Module that contains a controller in charge of
 * viewing a user's profile. TBD
 */

angular.module('userprofile', [])

.controller('UserProfileCtrl', function($scope, $stateParams) {
           $scope.user = $stateParams.user;
});


'use strict';

/*
 * Module that contains a controller in charge of
 * viewing a user's profile, both your own and other's
 */

angular.module('userprofile', [])

.controller('UserProfileCtrl', function($scope, $localStorage, $stateParams) {
        if ($stateParams.user) {
           $scope.user  = $stateParams.user;
        } else {
            $scope.user = $localStorage.user;
        }
        console.log($scope.user);
});


Allow user profile controller to also load data from localStorage
Allow user profile controller to also load data from localStorage
