You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import * as firebase from 'firebase/app';
|
|
import { AngularFireAuth } from 'angularfire2/auth';
|
|
import { Router } from '@angular/router';
|
|
import { HomeService } from '../../services/home/home.service';
|
|
import { OpCommercialService } from '../../services/opCommercial/op-commercial.service';
|
|
import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
|
|
|
|
@Component({
|
|
selector: 'app-home',
|
|
templateUrl: './home.component.html',
|
|
styleUrls: ['./home.component.scss'],
|
|
providers: [HomeService, OpCommercialService]
|
|
})
|
|
export class HomeComponent implements OnInit {
|
|
public loadComponentRegister = false;
|
|
public loadComponentLogin = false;
|
|
commList: FirebaseListObservable<any[]>;
|
|
constructor(public afAuth: AngularFireAuth, private opComService: OpCommercialService, private router: Router) {
|
|
try{
|
|
opComService.updateCarteEtOpCom();
|
|
this.commList = this.opComService.getCommercants();
|
|
this.commList.subscribe(tabCommercant => console.log(tabCommercant));
|
|
}catch (e){
|
|
console.log(e);
|
|
}
|
|
}
|
|
|
|
loadRegisterComponent(){
|
|
this.loadComponentRegister = !this.loadComponentRegister;
|
|
this.loadComponentLogin = false;
|
|
}
|
|
|
|
loadRegisterComponent2(){
|
|
this.loadComponentRegister = true;
|
|
this.loadComponentLogin = false;
|
|
}
|
|
|
|
|
|
loadLoginComponent(){
|
|
this.loadComponentLogin = !this.loadComponentLogin;
|
|
this.loadComponentRegister = false;
|
|
}
|
|
|
|
ngOnInit() {
|
|
firebase.auth().signOut();
|
|
}
|
|
|
|
|
|
}
|