Does anyone know how I can share data between form in angular? It happens that I have a table and when clicking on an id you must show me the detail of that id on another page, I am using this service to store the id but when redirecting me to the other page the id is lost
This is the code, sorry if this messy thing, I'm new using this tool
<div class="divPrincipal" ng-app="SolicitudesWeb" ng-controller="SeguimientoSolicitudesController as ctrl" >
<div class="table-responsive">
<table>
<tr>
<td class="tamañoLetraTablaTitulo">ID</td>
<td class="tamañoLetraTablaTitulo">DESCRIPCIÓN</td>
<td class="tamañoLetraTablaTitulo">REGISTRADA</td>
<td class="tamañoLetraTablaTitulo">SOLICITADA</td>
<td class="tamañoLetraTablaTitulo">DENEGADA</td>
<td class="tamañoLetraTablaTitulo">AUTORIZADA</td>
<td class="tamañoLetraTablaTitulo">COTIZACIÓN</td>
<td class="tamañoLetraTablaTitulo">VISTO BUENO</td>
<td class="tamañoLetraTablaTitulo">CANCELADA</td>
<td class="tamañoLetraTablaTitulo">CONCLUIDA</td>
</tr>
<tr ng-repeat="x in ctrl.SegSolic">
<td><a ng-click="ctrl.param(x.IdUr)">{{x.IdUr}}</a></td>
<td>{{x.Descripcion}}</td>
<td>{{x.Registrada}}</td>
<td>{{x.Solicitada}}</td>
<td>{{x.Denegada}}</td>
<td>{{x.Autorizada}}</td>
<td>{{x.Cotizacion}}</td>
<td>{{x.VistoBueno}}</td>
<td>{{x.Cancelada}}</td>
<td>{{x.Concluida}}</td>
</tr>
</table>
</div>
</div>
</div>
app.service('ServiceParametrosSolicitud', function () {
var message = '';
this.setMessage = function (msg) {
message = msg;
alert(message);
}
alert(message);
this.getMessage = function () {
return this.message;
}
})
app.controller('SeguimientoSolicitudesController', ['$scope','ServiceParametrosSolicitud', function ($scope, ServiceParametrosSolicitud) {
this.SegSolic = "";
this.SolicitudDetalle = "";
this.Parametro = "";
var self = this;
solicitudContext.obtenerListaSegSolicitudes(function (resp) {
switch (resp.ressult) {
case "tgp":
self.SegSolic = solicitudContext.ListaSeguimientoSolicitudes;
break;
case "notgp":
break;
default:
break;
}
$scope.$apply();
});
this.param = function (Id) {
ServiceParametrosSolicitud.setMessage(Id);
window.location.href = urlServer + "Home/About";
};
}]);
app.controller('SolicitudesController', ['$scope', 'ServiceParametrosSolicitud', function ($scope, ServiceParametrosSolicitud) {
this.SolicitudDetalle = "";
var self = this;
var dependencia = ServiceParametrosSolicitud.getMessage();
solicitudContext.obtenerListaSolicitudes(dependencia, function (resp) {
switch (resp.ressult) {
case "tgp":
self.SolicitudDetalle = solicitudContext.ListaSolicitudes;
break;
case "notgp":
break;
default:
break;
}
$scope.$apply();
});
}]);