Merge branch 'thierry' of ssh://git.marbelium.com:10023/Viiciouss/XJC into anis
commit
6180e00d43
@ -1,15 +1,51 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { OperationCommerciale } from '../../../../models/OperationCommerciale';
|
||||
import { AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2/database';
|
||||
|
||||
import * as firebase from 'firebase/app';
|
||||
import { AngularFireAuth } from 'angularfire2/auth';
|
||||
import { AuthService } from '../../../services/auth/auth.service';
|
||||
import { OpCommercialService } from '../../../services/opCommercial/op-commercial.service';
|
||||
import { Commercant } from '../../../../models/Commercant';
|
||||
|
||||
@Component({
|
||||
selector: 'app-liste-op-commercial',
|
||||
templateUrl: './liste-op-commercial.component.html',
|
||||
styleUrls: ['./liste-op-commercial.component.scss']
|
||||
styleUrls: ['./liste-op-commercial.component.scss'],
|
||||
providers: [AuthService, OpCommercialService]
|
||||
})
|
||||
export class ListeOpCommercialComponent implements OnInit {
|
||||
export class ListeOpCommercialComponent implements OnInit, OnDestroy {
|
||||
opComm: OperationCommerciale;
|
||||
user: Observable<firebase.User>;
|
||||
opCommData: FirebaseListObservable<any[]>;
|
||||
profileData: FirebaseListObservable<any[]>;
|
||||
commercant: Commercant;
|
||||
|
||||
constructor() { }
|
||||
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
|
||||
private router: Router, private authService: AuthService, private opComService: OpCommercialService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
try {
|
||||
this.user.subscribe(
|
||||
(auth) => {
|
||||
if (auth) {
|
||||
console.log(auth.uid);
|
||||
} else {
|
||||
// this.router.navigate(['/']);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
// No content response..
|
||||
console.log(e);
|
||||
// this.router.navigate(['/']);
|
||||
}
|
||||
}
|
||||
ngOnDestroy() {}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue