Modify method to show success/failed Message. AngularJS <p>I´m pretty new to angularJS and I cant seem to find a good way to show a SUCCESS or ERROR message for the return of my Save method.</p> <p>Heres the html code:</p> <pre><code>&lt;form role="form"&gt; &lt;div class="panel-body"&gt; &lt;div class="panel-body"&gt; &lt;img src="/assets/doge.jpg" alt="Doge"&gt; &lt;/div&gt; &lt;div class="container"&gt; &lt;div class="input-group"&gt; &lt;span class="input-group-addon" id="tec-nombre"&gt;Nombre del Tecnico:&lt;/span&gt;&lt;input type="text" class="form-control" data-ng-model="tecnico.nombre" aria-describedby="tec-nombre"&gt; &lt;div role="alert"&gt; &lt;span class="error" data-ng-show="myForm.nombreTecnico.$error.required"&gt; Required!&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="input-group"&gt; &lt;span class="input-group-addon" id="tec-legajo"&gt;Legajo del Tecnico:&lt;/span&gt;&lt;input type="number" class="form-control" data-ng-model="tecnico.legajo" aria-describedby="tec-legajo"&gt; &lt;div role="alert"&gt; &lt;span class="error" data-ng-show="myForm.legajoTecnico.$error.required"&gt; Required!&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="input-group"&gt; &lt;span class="input-group-addon" id="tec-email"&gt;Email del Tecnico:&lt;/span&gt;&lt;input type="email" class="form-control" data-ng-model="tecnico.email" aria-describedby="tec-email"&gt; &lt;div role="alert"&gt; &lt;span class="error" data-ng-show="myForm.emailTecnico.$error.required"&gt; Required!&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="input-group"&gt; &lt;span class="input-group-addon" id="tec-interno"&gt;Interno del Tecnico:&lt;/span&gt;&lt;input type="text" class="form-control" data-ng-model="tecnico.interno" aria-describedby="tec-interno"&gt; &lt;div role="alert"&gt; &lt;span class="error" data-ng-show="myForm.nombreTecnico.$error.required"&gt; Required!&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label class="col-md-2"&gt;&lt;/label&gt; &lt;div class="col-md-4"&gt; &lt;a href="#/" class="btn"&gt;Cancel&lt;/a&gt; &lt;a data-ng-click="saveTecnico(tecnico);" href="#/test" class="btn btn-primary"&gt;Actualizar {{tecnico.legajo}}&lt;/a&gt; &lt;button data-ng-click="deleteCustomer(customer)" data-ng-show="customer._id" class="btn btn-warning"&gt;Delete&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>And heres the Angular Code:</p> <pre><code> angular.module('incidente', [ 'ngRoute' , 'ui.tree' ]) .config([ '$routeProvider', function($routeProvider) { $routeProvider.when('/', { templateUrl : 'partials/home.html' }).when('/incidente/:codename', { templateUrl : 'partials/incidente.html', controller : 'IncidenteController' }).when('/incidentes', { templateUrl : 'partials/incidentes.html', controller : 'IncidentesController' }).when('/tecnicos', { templateUrl : 'partials/tecnicos.html', controller : 'TecnicosController' }).when('/tecnico/:legajo', { templateUrl : 'partials/tecnico.html', controller : 'TecnicoController' }).when('/sistema/:nombre', { templateUrl : 'partials/sistema.html', controller : 'SistemaController' }).when('/sistemas', { templateUrl : 'partials/sistemas.html', controller : 'SistemasController' }).when('/hardware/:codename', { templateUrl : 'hardware.html', controller : 'HardwareController' }).when('/hardwares', { templateUrl : 'partials/hardwares.html', controller : 'HardwaresController' }).when('/software/:codename', { templateUrl : 'partials/software.html', controller : 'SoftwareController' }).when('/softwares', { templateUrl : 'partials/softwares.html', controller : 'SoftwaresController' }).when('/readme', { templateUrl : 'partials/readme.html', controller : '' }).when('/test', { templateUrl : '/partials/tecnicos.html', controller : 'TecnicosController' }).otherwise({ redirectTo : '/' }); } ]) .controller('home', function($scope, $http) { $http.get('/resource/').success(function(data) { $scope.greeting = data; }) }) .controller( 'navigation', function($rootScope, $scope, $http, $location) { var authenticate = function(credentials, callback) { var headers = credentials ? { authorization : "Basic " + btoa(credentials.username + ":" + credentials.password) } : {}; $http.get('user', { headers : headers }).success(function(data) { if (data.name) { $rootScope.authenticated = true; } else { $rootScope.authenticated = false; } callback &amp;&amp; callback(); }).error(function() { $rootScope.authenticated = false; callback &amp;&amp; callback(); }); } authenticate(); $scope.credentials = {}; $scope.login = function() { authenticate($scope.credentials, function() { if ($rootScope.authenticated) { $location.path("/"); $scope.error = false; } else { $location.path("/login"); $scope.error = true; } }); }; }) .controller( 'IncidenteController', [ '$scope', '$http', '$routeParams', function($scope, $http, $routeParams) { var urlbase = "http://localhost:8080/"; var onError = function(reason) { $scope.error = "No se pudo encontrar"; }; var code = $routeParams.codename; console.log(code); var onIncidenteComplete = function(response) { try { $scope.incidente = response.data; } catch (error) { console.error(error); } }; $http.get(urlbase + "get/incidente/" + code).then( onIncidenteComplete, onError); $scope.saveIncidente = function(incidente) { console.log(incidente); return $http.post(urlbase + "set/incidente/" + incidente) }; } ]) .controller( 'IncidentesController', [ '$scope', '$http', function($scope, $http) { var urlbase = "http://localhost:8080/"; var onError = function(reason) { $scope.error = "No se pudo encontrar"; }; var onIncidenteComplete = function(response) { try { $scope.incidentes = angular .fromJson(response.data); console.log($scope.incidentes); } catch (error) { console.error(error); } }; $http.get(urlbase + "get/incidente/").then( onIncidenteComplete, onError); } ]) .controller( 'TecnicoController', [ '$scope', '$http', '$routeParams', function($scope, $http, $routeParams) { var onError = function(reason) { $scope.error = "No se pudo encontrar"; }; var urlbase = "http://localhost:8080/"; var legajo = $routeParams.legajo; var onTecnicoComplete = function(response) { try { $scope.tecnico = response.data; } catch (error) { console.error(error); } }; $http.get(urlbase + "get/tecnico/" + legajo) .then(onTecnicoComplete, onError); $scope.saveTecnico = function(tecnico) { return $http.post(urlbase + "set/tecnico/", tecnico) }; This is the function that saves the tecnico and should show the error/success message. } ]) .controller( 'TecnicosController', [ '$scope', '$http', function($scope, $http) { var onError = function(reason) { $scope.error = "No se pudo encontrar"; }; var onTecnicoComplete = function(response) { $scope.tecnicos = response.data; }; $http.get("http://localhost:8080/get/tecnico/") .then(onTecnicoComplete, onError); } ]) .controller( 'SistemasController', [ '$scope', '$http', function($scope, $http) { var urlbase = "http://localhost:8080/get/"; var onError = function(reason) { $scope.error = "No se pudo encontrar"; }; var onSistemaComplete = function(response) { $scope.sistemas = response.data; }; $http.get(urlbase + "sistema/").then( onSistemaComplete, onError); } ]); </code></pre> <p>So far is just a redirect, but I want to show a success or error message before te redirect to help the user understand what happened.</p>