Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpapa committed Mar 30, 2020
1 parent 4dc6f0a commit f974bf4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import {
Output,
ViewChild,
SimpleChanges
} from '@angular/core';
} from "@angular/core";

import { Hero } from '../../core';
import { Hero } from "../../core";

@Component({
selector: 'app-hero-detail',
templateUrl: './hero-detail.component.html',
styleUrls: ['./hero-detail.component.scss']
selector: "app-hero-detail",
templateUrl: "./hero-detail.component.html",
styleUrls: ["./hero-detail.component.scss"]
})
export class HeroDetailComponent implements OnChanges {
@Input() hero: Hero;
@Output() unselect = new EventEmitter<string>();
@Output() add = new EventEmitter<Hero>();
@Output() update = new EventEmitter<Hero>();

@ViewChild('name') nameElement: ElementRef;
@ViewChild("name", { static: true }) nameElement: ElementRef;

addMode = false;
editingHero: Hero;
Expand All @@ -33,7 +33,7 @@ export class HeroDetailComponent implements OnChanges {
this.editingHero = { ...this.hero };
this.addMode = false;
} else {
this.editingHero = { id: undefined, name: '', saying: '' };
this.editingHero = { id: undefined, name: "", saying: "" };
this.addMode = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ import {
Output,
ViewChild,
SimpleChanges
} from '@angular/core';
} from "@angular/core";

import { Villain } from '../../core';
import { Validators, FormBuilder, FormGroup } from '@angular/forms';
import { Villain } from "../../core";
import { Validators, FormBuilder, FormGroup } from "@angular/forms";

@Component({
selector: 'app-villain-detail',
templateUrl: './villain-detail.component.html',
styleUrls: ['./villain-detail.component.scss']
selector: "app-villain-detail",
templateUrl: "./villain-detail.component.html",
styleUrls: ["./villain-detail.component.scss"]
})
export class VillainDetailComponent implements OnChanges {
@Input() villain: Villain;
@Output() unselect = new EventEmitter<string>();
@Output() add = new EventEmitter<Villain>();
@Output() update = new EventEmitter<Villain>();

@ViewChild('name') nameElement: ElementRef;
@ViewChild("name", { static: true }) nameElement: ElementRef;

addMode = false;

form = this.fb.group({
id: [],
name: ['', Validators.required],
saying: ['']
name: ["", Validators.required],
saying: [""]
});

constructor(private fb: FormBuilder) {}
Expand Down

0 comments on commit f974bf4

Please sign in to comment.