Skip to content

Commit

Permalink
Fixes en creacion
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres committed Jan 31, 2018
1 parent d623366 commit 20de1bb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
<button (click)="visiblePop = !visiblePop" style="margin: 7px;" type="button" class="btn">{{titulo}}</button>
<change-state [(visible)]="visiblePop">
<h2 style="margin: 10px;margin-bottom: 20px;" >{{titulo}}</h2>
<input #nombreEmpresa type="text" name="" placeholder="Nombre Empresa"
(change)="nombreAux=nombreEmpresa.value">
<input #logoEmpresa type="text" name="" placeholder="Logo Empresa"
(change)="logoAux=logoEmpresa.value" >
<input #nombreEmpresa type="text" name="" placeholder="Nombre Empresa" name="nombreAux" ng-control="nombreAux" [(ngModel)]="nombreAux" >
<input #logoEmpresa type="text" name="" placeholder="Logo Empresa" (change)="logoAux=logoEmpresa.value" >

<div class="row">
<div class="col-6">
<button (click)="visiblePop=!visiblePop" class="btn" style="width: 100%;background: #72C585"
(click)="createEmpresa(nombreAux, logoAux)" >Listo</button>
[disabled]="nombreAux == ''" (click)="createEmpresa(nombreAux, logoAux)" >Listo</button>
</div>
</div>
</change-state>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import { Client } from 'app/data-objects/c
import { Trabajo } from 'app/data-objects/trabajo';

import { CuerpoColegiado } from 'app/data-objects/cuerpoColegiado';
import { CuerpoColegiadoSelect } from 'app/data-objects/cuerpoColegiadoSelect';
import { CuerpoColegiadoSelect } from 'app/data-objects/cuerpoColegiadoSelect';
import { Acta } from 'app/data-objects/acta';
import { UsuarioActa } from 'app/data-objects/usuarioActa';
import { Usuario } from 'app/data-objects/usuario';
import {Observable} from 'rxjs/Rx';
import {Subscription} from 'rxjs';


@Component({
Expand All @@ -31,32 +33,37 @@ export class CreateUserComponent implements OnInit, OnDestroy {
private route : ActivatedRoute,
private service: Service)
{

this.cuerposColegiado = [];

}

quitarToken(){
localStorage.setItem('empresa-creada','');
}
temporizador = Observable.interval(1000).map(
()=> this.refresh()
);

ngOnDestroy(): void {
this.quitarToken();
}

ngOnInit(): void {
refresh():boolean{

if (this.empresaCreada != localStorage.getItem('empresa-creada'))
{
this.empresaCreada = localStorage.getItem('empresa-creada');



this.service.getCuerpoColegiados().subscribe(
this.service.getCuerpoColegiadosSimple(this.empresaCreada).subscribe(
response =>{

for (let cc of response) {
this.cuerposColegiado.push(new CuerpoColegiadoSelect(cc.id, cc.nombre, cc.actas));
}
});
}
return true;
}

ngOnInit(): void {

this.refresh();

};

Expand All @@ -69,8 +76,6 @@ export class CreateUserComponent implements OnInit, OnDestroy {
listaCC = listaCC + '&ccList=' + cc.id;
}

console.log ('Valid' + listaCC != '')

return listaCC != '';


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2 style="margin: 10px;margin-bottom: 20px;" >{{titulo}}</h2>
(click)="nombreAux=transfer.nombreEmpresa"
>Editar</button>
</td>
<td>
<td *ngIf="!transfer.edit" >
<create-user (click)="setEmpresaLocalSto(transfer)"></create-user>
</td>
<!-- Modo Edicion -->
Expand Down

0 comments on commit 20de1bb

Please sign in to comment.