This server is intended for use for Academic Classwork related Git repositories only. Projects/repositories will generally be removed after 6 months following close of the semester. Inactive repositories from previous semester are now being archived when no activity for 365 days. They are renamed and marked as 'archived'. After 90 days in that state they will be removed from the system completely.

Commit a2fdf8b8 authored by pmdv46's avatar pmdv46

added simple upgrade to change picture of main clicker

parent 37bc6b41
import { Component, Output, Input, AfterViewInit, ViewChild } from '@angular/core';
import { AccumulatorsComponent } from '../accumulator/accumulator.component';
@Component({
selector: 'app-click',
templateUrl: './click.component.html',
styleUrls: ['./click.component.scss'],
})
export class ClickComponent implements AfterViewInit {
totalClicks = 0;
clickMulti = 1;
@ViewChild(AccumulatorsComponent) accumulate;
constructor() { }
message: number;
ngAfterViewInit() {
this.totalClicks = this.accumulate.message
}
}
......@@ -10,7 +10,7 @@ export class AccumulatorsComponent {
totalClicks = 0;
clickMulti = 1;
constructor() {}
constructor() { }
jarUpgrade() {
this.clickMulti += 5;
......
<button mat-raised-button (click)="upgrade()">
<h4>
Upgrade
</h4>
</button>
<button mat-raised-button>
<img src="assets/pickle-fingers.png" (click)="increment()" />
<img [src]="upgradeLevel" (click)="increment()" />
</button>
<h4># of Clicks: {{ totalClicks }}</h4>
<h4># of Clicks: {{ totalClicks }}</h4>
\ No newline at end of file
......@@ -12,4 +12,4 @@ img {
h4 {
text-align: center;
}
}
\ No newline at end of file
import { style } from '@angular/animations';
import { Component } from '@angular/core';
@Component({
......@@ -8,8 +9,13 @@ import { Component } from '@angular/core';
export class ClickComponent {
totalClicks = 0;
clickMulti = 1;
upgradeLevel = 'assets/Hamburger.png';
constructor() {}
constructor() { }
upgrade() {
this.upgradeLevel = 'assets/BabyDill.png';
}
increment() {
this.totalClicks += this.clickMulti;
......
......@@ -10,4 +10,4 @@ const cmsRoutes: Routes = [{ path: '', component: ClickComponent }];
imports: [CommonModule, RouterModule.forChild(cmsRoutes)],
exports: [ClickComponent],
})
export class ClickModule {}
export class ClickModule { }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment