'use strict';

angular
  .module('myApp')
  .controller('userProfileCtrl', function ($scope, $location, $routeParams, userService) {

    userService.getUserInfo($routeParams.id)
      .then(function (response) {
        $scope.userData = response.data;
      });

    $scope.update = function () {
      userService.updateUserInfo($routeParams.id, $scope.userData)
        .then(function (response) {
          if(response.data.code) {
            swal({
              title: "Информация не обновлена",
              text: "Повторите попытку",
              confirmButtonText: "ОК",
              html: true
            });
          }
          else {
            swal({
              title: "Информация успешно обновлена",
              text: "После выхода данные будут успешные применены",
              confirmButtonText: "ОК",
              html: true
            });
          }
        });

    };

    $scope.updatePassword = function () {
      var data = {
        "username": $scope.userData.username,
        "email": $scope.userData.email,
        "password": $scope.settingPassword.password,
        "date": $scope.userData.date
      };
      userService.updateUserInfo($routeParams.id, data)
        .then(function () {
          swal({
            title: "Информация успешно обновлена",
            text: "После выхода данные будут успешные применены",
            confirmButtonText: "ОК",
            html: true
          });
        });
    };

  });
@@ -407,16 +407,17 @@
       if
+ 
 (respons
@@ -448,39 +448,16 @@
    swal(
-%7B%0A              title: 
 %22%D0%98%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0
@@ -474,36 +474,16 @@
 %D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%B0%22,
-%0A              text:
  %22%D0%9F%D0%BE%D0%B2%D1%82%D0%BE%D1%80
@@ -499,86 +499,16 @@
 %D0%BA%D1%83%22,
-%0A              confirmButtonText: %22%D0%9E%D0%9A%22,%0A              html: true%0A            %7D
+ %22error%22
 );%0A 
@@ -556,31 +556,8 @@
 wal(
-%7B%0A              title: 
 %22%D0%98%D0%BD%D1%84
@@ -587,28 +587,8 @@
 %D0%BD%D0%B0%22,
-%0A              text:
  %22%D0%9F%D0%BE
@@ -635,86 +635,18 @@
 %D0%BD%D1%8B%22,
-%0A              confirmButtonText: %22%D0%9E%D0%9A%22,%0A              html: true%0A            %7D
+ %22success%22
 );%0A 
@@ -1026,29 +1026,8 @@
 wal(
-%7B%0A            title: 
 %22%D0%98%D0%BD%D1%84
@@ -1057,26 +1057,8 @@
 %D0%BD%D0%B0%22,
-%0A            text:
  %22%D0%9F%D0%BE
@@ -1105,80 +1105,18 @@
 %D0%BD%D1%8B%22,
-%0A            confirmButtonText: %22%D0%9E%D0%9A%22,%0A            html: true%0A          %7D
+ %22success%22
 );%0A 

Change alert