34 lines
844 B
TypeScript
34 lines
844 B
TypeScript
import {Component, OnInit} from '@angular/core';
|
|
import {Army} from '../models/model-interfaces';
|
|
import {ArmyService} from '../services/army-service/army.service';
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
import {Fraction} from '../utils/fraction.enum';
|
|
|
|
|
|
@Component({
|
|
selector: 'cc-army',
|
|
templateUrl: './army.component.html',
|
|
styleUrls: ['./army.component.scss']
|
|
})
|
|
export class ArmyComponent implements OnInit {
|
|
|
|
army: Army[] = [{}, {}];
|
|
|
|
readonly fraction = Fraction;
|
|
|
|
constructor(private router: Router,
|
|
private route: ActivatedRoute,
|
|
private armyService: ArmyService) {
|
|
}
|
|
|
|
ngOnInit() {
|
|
this.armyService.getArmies().subscribe(army => {
|
|
this.army = army;
|
|
});
|
|
};
|
|
|
|
select(memberId) {
|
|
this.router.navigate(['member', memberId], {relativeTo: this.route});
|
|
}
|
|
}
|