(function () { 'use strict'; let Explanation = function ($scope, userService, $location) { $scope.name = 'Hey,'; userService.getUser() .then(function (data) { $scope.name = data.userName; }); $scope.callback = function (prompt) { $location.url('memory/' + prompt.promptId + '/first'); } }; Explanation.$inject = ['$scope', 'userService', '$location']; angular.module('streamApp').controller('explanationController', Explanation); })();