Browse Source

7.5 using @types/(package).

Frederic G. MARAND 5 years ago
parent
commit
55df459ef5
3 changed files with 9 additions and 1 deletions
  1. 4 1
      app/scoreboard.ts
  2. 3 0
      index.html
  3. 2 0
      package.json

+ 4 - 1
app/scoreboard.ts

@@ -1,10 +1,13 @@
-import {Result} from "./result";
+import {Result} from './result';
+import * as _ from 'lodash';
 
 export class Scoreboard {
   private results: Result[] = [];
 
   addResult(newResult: Result): void {
     this.results.push(newResult);
+    let allCaps: string = _.upperCase(newResult.playerName);
+    console.log(`${allCaps} - ${newResult.score}`);
   }
 
   updateScoreboard(): void {

+ 3 - 0
index.html

@@ -57,6 +57,9 @@
         <script src="node_modules/systemjs/dist/system.js"></script>
         <script>
             System.config({
+              paths: {
+                'lodash': 'node_modules/lodash/lodash',
+              },
               meta: {
                 format: 'cjs',
               },

+ 2 - 0
package.json

@@ -2,6 +2,8 @@
   "author": "Bruce Wilson",
   "description": "Simple math game built with TypeScript",
   "dependencies": {
+    "@types/lodash": "^4.14.116",
+    "lodash": "^4.17.10",
     "systemjs": "~0.20"
   },
   "devDependencies": {