2018-04-18 11:27:27 +00:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2018-04-18 12:57:58 +00:00
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
import { PagesComponent } from 'app/pages/pages.component';
|
|
|
|
|
|
|
|
import * as AuthStore from '../../store/auth';
|
|
|
|
import { Member } from '../../model';
|
|
|
|
import { AuthSelector } from '../../store';
|
|
|
|
import { Store } from '@ngrx/store';
|
|
|
|
import {FormBuilder, FormGroup} from '@angular/forms';
|
|
|
|
|
2018-04-18 11:27:27 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'of-member-profile',
|
|
|
|
templateUrl: './profile.component.html',
|
|
|
|
styleUrls: ['./profile.component.scss']
|
|
|
|
})
|
|
|
|
export class ProfileComponent implements OnInit {
|
|
|
|
|
2018-04-18 12:57:58 +00:00
|
|
|
member: Member;
|
|
|
|
modifyForm: FormGroup;
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
public app: PagesComponent,
|
|
|
|
private activatedRoute: ActivatedRoute,
|
|
|
|
private router: Router,
|
|
|
|
private store: Store<AuthStore.State>,
|
|
|
|
private formBuilder: FormBuilder,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
2018-04-18 11:27:27 +00:00
|
|
|
|
|
|
|
ngOnInit() {
|
2018-04-18 12:57:58 +00:00
|
|
|
this.store.select(AuthSelector.select('member')).subscribe(
|
|
|
|
(member: Member) => {
|
|
|
|
this.member = member;
|
|
|
|
},
|
|
|
|
(error) => {
|
|
|
|
console.log(error);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
this.initForm();
|
|
|
|
}
|
|
|
|
|
|
|
|
initForm() {
|
|
|
|
this.modifyForm = this.formBuilder.group({
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
modifyProfile() {
|
|
|
|
console.log('clicked');
|
2018-04-18 11:27:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|