Skip to content

Exercise 9 - Templates - Buying Socks #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

jonathanrasquin
Copy link

No description provided.

@jonathanrasquin
Copy link
Author

excuses, master vergeten te resetten :) volgende PR in orde

showAlertMessage(message: string, type: string) {
this.alertMessage = message;
this.alertType = type;
this.showAlert = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minder fields, minder dingen om in sync te houden::

get showAlert(): boolean {
  return !!this.alertMessage;
}

BUY NOW
</button>
<div *ngIf="showAlert" [ngClass]="alertType" class="alert">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of hier gewoon: *ngIf="!!alertMessage"


<button type="button" class="buy-socks" (click)="buy()">
<p *ngIf="sock.inventory === 0" class="badge">SOLD OUT</p>
<button type="button" class="buy-socks" (click)="buy()" *ngIf="sock.inventory > 0">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je hoeft niet altijd een functie te gebruiken:
(is waarschijnlijk ook (persoonlijke) smaak)

<button (click)="showModal = true">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants