Note: This is a short warm-up question meant to help you familiarize yourself with the coding workspace. Actual UI coding interview questions will be more complicated.
Make the text within the button display the number of times the button has been clicked.
This is a short question that only requires one state variable: the number of times the button has been clicked (count).
Declare count as an instance variable and create a method increment that increments the count. This method is bound to the <button>'s click action and will be called when the <button> is clicked.
{"$schema": "./node_modules/@angular/cli/lib/config/schema.json","version": 1,"newProjectRoot": "projects","defaultProject": "greatfrontend","projects": {"greatfrontend": {"projectType": "application","schematics": {},"root": "","sourceRoot": "src","prefix": "app","architect": {"build": {"builder": "@angular-devkit/build-angular:browser","options": {"outputPath": "dist/my-app","index": "src/index.html","main": "src/main.ts","polyfills": ["zone.js"],"tsConfig": "tsconfig.app.json","assets": ["src/favicon.ico", "src/assets"],"styles": ["src/styles.css"],"scripts": []},"configurations": {"production": {"budgets": [{"type": "initial","maximumWarning": "500kb","maximumError": "1mb"},{"type": "anyComponentStyle","maximumWarning": "2kb","maximumError": "4kb"}],"outputHashing": "all"},"development": {"buildOptimizer": false,"optimization": false,"vendorChunk": true,"extractLicenses": false,"sourceMap": true,"namedChunks": true}},"defaultConfiguration": "production"},"serve": {"builder": "@angular-devkit/build-angular:dev-server","configurations": {"production": {"browserTarget": "greatfrontend:build:production"},"development": {"browserTarget": "greatfrontend:build:development"}},"defaultConfiguration": "development"},"extract-i18n": {"builder": "@angular-devkit/build-angular:extract-i18n","options": {"browserTarget": "greatfrontend:build"}},"test": {"builder": "@angular-devkit/build-angular:karma","options": {"polyfills": ["zone.js", "zone.js/testing"],"tsConfig": "tsconfig.spec.json","assets": ["src/favicon.ico", "src/assets"],"styles": ["src/styles.css"],"scripts": []}}}}},"cli": {"analytics": "7ca5c4d0-e5db-4d23-9ffd-8c8c042e34e7"}}
console.log() statements will appear here.