-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
state en lugar de switch para elegir tipo de propiedad
- Loading branch information
Showing
7 changed files
with
42 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
function CrearPropiedadCtrl(PropiedadesHome) { | ||
function CrearPropiedadCtrl(PropiedadesHome, $state) { | ||
var self = this; | ||
self.propiedad = {}; | ||
self.tiposDePropiedad = [{ nombre: "Hotel" }, { nombre: "Particular"}] | ||
|
||
self.guardar = function () { | ||
PropiedadesHome.create(self.propiedad); | ||
} | ||
}; | ||
|
||
self.abrirTipoPropiedad = function () { | ||
$state.go("main.alta_propiedades." + self.propiedad.tipo.nombre.toLowerCase()); | ||
}; | ||
}; | ||
|
||
angular.module("booking-app") | ||
.controller("CrearPropiedadCtrl", CrearPropiedadCtrl); | ||
|
||
CrearPropiedadCtrl.$inject = [ "PropiedadesHome" ]; | ||
CrearPropiedadCtrl.$inject = [ "PropiedadesHome", "$state" ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
function EditarPropiedadCtrl(PropiedadesHome, propiedad) { | ||
function EditarPropiedadCtrl(PropiedadesHome, propiedad, $state) { | ||
var self = this; | ||
self.propiedad = propiedad; | ||
self.tiposDePropiedad = [{ nombre: "Hotel" }, { nombre: "Particular"}] | ||
|
||
self.guardar = function () { | ||
PropiedadesHome.update(self.propiedad); | ||
} | ||
}; | ||
|
||
self.abrirTipoPropiedad = function () { | ||
$state.go("main.editar_propiedades." + self.propiedad.tipo.nombre.toLowerCase()); | ||
}; | ||
}; | ||
|
||
angular.module("booking-app") | ||
.controller("EditarPropiedadCtrl", EditarPropiedadCtrl); | ||
|
||
EditarPropiedadCtrl.$inject = [ "PropiedadesHome", "propiedad" ]; | ||
EditarPropiedadCtrl.$inject = [ "PropiedadesHome", "propiedad", "$state" ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="form-group"> | ||
<label>Cantidad de estrellas</label> | ||
<input class="form-control" ng-model="formCtrl.propiedad.tipo.cantidadEstrellas" placeholder="Del 1 a 5"> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="form-group"> | ||
<label>Antigüedad</label> | ||
<input class="form-control" ng-model="formCtrl.propiedad.tipo.antiguedad" placeholder="Por ejemplo: 20 años"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Cantidad de baños</label> | ||
<input class="form-control" ng-model="formCtrl.propiedad.tipo.banios" placeholder="Por ejemplo: 1"> | ||
</div> |