Last change
on this file since fa375fe was fa375fe, checked in by Ema <ema_spirova@…>, 3 years ago |
adding new components
|
-
Property mode
set to
100644
|
File size:
958 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | import { Component, OnInit } from '@angular/core';
|
---|
| 2 | import { Planner } from '../_models/planner';
|
---|
| 3 | import { PlannerService } from '../_services/planner.service';
|
---|
[fa375fe] | 4 | import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
|
---|
| 5 | import { CreateInitialPlannerComponent } from '../create-initial-planner/create-initial-planner.component';
|
---|
| 6 |
|
---|
[6a3a178] | 7 |
|
---|
| 8 | @Component({
|
---|
| 9 | selector: 'app-planner',
|
---|
| 10 | templateUrl: './planner.component.html',
|
---|
| 11 | styleUrls: ['./planner.component.css']
|
---|
| 12 | })
|
---|
| 13 | export class PlannerComponent implements OnInit {
|
---|
| 14 |
|
---|
| 15 | planners: Planner[];
|
---|
[fa375fe] | 16 | constructor(private plannerService: PlannerService, public dialog: MatDialog) {
|
---|
[6a3a178] | 17 | this.planners = [];
|
---|
[fa375fe] | 18 | };
|
---|
| 19 |
|
---|
| 20 | openDialog(): void {
|
---|
| 21 | const dialogRef = this.dialog.open(CreateInitialPlannerComponent, {
|
---|
| 22 | width: '250px',
|
---|
| 23 | data: {}
|
---|
| 24 | });
|
---|
[6a3a178] | 25 | }
|
---|
[fa375fe] | 26 |
|
---|
[6a3a178] | 27 | ngOnInit(): void {
|
---|
| 28 | this.plannerService.getAllPlanners().subscribe(
|
---|
| 29 | data => {
|
---|
| 30 | this.planners = data;
|
---|
| 31 | }
|
---|
| 32 | );
|
---|
| 33 | }
|
---|
[fa375fe] | 34 |
|
---|
[6a3a178] | 35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.