Hi guys, I can’t understand why when I add $ionicHistory to my controller, the form in the view of that controller gets deleted. Any help?
This is my controller
.controller('ScaleNewCtrl', function($scope, $rootScope, $http, $ionicHistory ) {
$scope.ruta= null;
$scope.origen= null;
$scope.destino= null;
$scope.fecha_salida= null;
$scope.fecha_llegada= null;
$scope.tac_salida= null;
$scope.tac_llegada= null;
$scope.tiempo_total= null;
$scope.combustible= null;
$scope.fuel_bs= null;
$scope.fuel_dls= null;
$scope.tax_bs= null;
$scope.tax_dls= null;
$scope.observaciones= null;
$scope.salvar = function () {
var url = "http://localhost:3000/newscale";
var numero = $rootScope.flightid;
$http.post (url,{ruta: $scope.ruta,
origen: $scope.origen,
destino: $scope.destino,
fecha_salida: $scope.fecha_salida,
fecha_llegada: $scope.fecha_llegada,
tac_salida: $scope.tac_salida,
tac_llegada: $scope.tac_llegada,
tiempo_total: $scope.tiempo_total,
combustible: $scope.combustible,
fuel_bs: $scope.fuel_bs,
fuel_dls: $scope.fuel_dls,
tax_bs: $scope.tax_bs,
tax_dls: $scope.tax_dls,
observaciones: $scope.observaciones,
flight_id: numero
})
.then(function(resp) {
console.log(resp);
}, function(err) {
console.error('ERR', err);
// err.status will contain the status code
});
alert('Escala Enviada');
},
$scope.asignarRuta = function (v) {
$scope.ruta = v;
},
$scope.asignarOrigen = function (w) {
$scope.origen = w;
},
$scope.asignarDestino = function (x) {
$scope.destino = x;
},
$scope.asignarFechaSalida = function (j) {
$scope.fecha_salida = j;
},
$scope.asignarFechaLlegada = function (k) {
$scope.fecha_llegada = k;
},
$scope.asignarTacSalida = function (o) {
$scope.tac_salida = o;
}
$scope.asignarTacLlegada = function (z) {
$scope.tac_llegada = z;
},
$scope.asignarTiempoTotal = function (a) {
$scope.tiempo_total = a;
},
$scope.asignarCombustible = function (b) {
$scope.combustible = b;
},
$scope.asignarFuelBs = function (c) {
$scope.fuel_bs = c;
},
$scope.asignarFuelDls = function (d) {
$scope.fuel_dls = d;
},
$scope.asignarTaxBs = function (e) {
$scope.tax_bs = e;
},
$scope.asignarTaxDls = function (f) {
$scope.tax_dls = f;
},
$scope.asignarObservaciones = function (g) {
$scope.observaciones = g;
}
})