Skip to content

Commit 3ab4e68

Browse files
committed
RxJS fix, dependencies update and console log commented
1 parent de0ec00 commit 3ab4e68

File tree

5 files changed

+70
-68
lines changed

5 files changed

+70
-68
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A small AI application containing [Angular 5](https://angular.io), [Material](ht
1313
## Features
1414
* Angular 5
1515
* Material Design
16-
* RXJS observables
16+
* RxJS observables
1717
* Dialogflow AI
1818
* Chatbot
1919

package-lock.json

Lines changed: 46 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@
3232
"prod:opt": "ng build --prod --build-optimizer"
3333
},
3434
"dependencies": {
35-
"@angular/animations": "^5.0.0",
35+
"@angular/animations": "^5.0.1",
3636
"@angular/cdk": "^2.0.0-beta.12",
37-
"@angular/common": "^5.0.0",
38-
"@angular/compiler": "^5.0.0",
39-
"@angular/core": "^5.0.0",
40-
"@angular/forms": "^5.0.0",
41-
"@angular/http": "^5.0.0",
37+
"@angular/common": "^5.0.1",
38+
"@angular/compiler": "^5.0.1",
39+
"@angular/core": "^5.0.1",
40+
"@angular/forms": "^5.0.1",
41+
"@angular/http": "^5.0.1",
4242
"@angular/material": "^2.0.0-beta.12",
43-
"@angular/platform-browser": "^5.0.0",
44-
"@angular/platform-browser-dynamic": "^5.0.0",
45-
"@angular/platform-server": "^5.0.0",
46-
"@angular/router": "^5.0.0",
43+
"@angular/platform-browser": "^5.0.1",
44+
"@angular/platform-browser-dynamic": "^5.0.1",
45+
"@angular/platform-server": "^5.0.1",
46+
"@angular/router": "^5.0.1",
4747
"core-js": "^2.5.1",
4848
"hammerjs": "^2.0.8",
4949
"rxjs": "^5.5.2",
@@ -52,12 +52,12 @@
5252
},
5353
"devDependencies": {
5454
"@angular/cli": "^1.5.0",
55-
"@angular/compiler-cli": "^5.0.0",
56-
"@angular/language-service": "^5.0.0",
57-
"@types/jasmine": "^2.6.2",
58-
"@types/node": "^8.0.47",
55+
"@angular/compiler-cli": "^5.0.1",
56+
"@angular/language-service": "^5.0.1",
57+
"@types/jasmine": "^2.6.3",
58+
"@types/node": "^8.0.50",
5959
"api-ai-javascript": "^2.0.0-beta.21",
60-
"codelyzer": "^4.0.0",
60+
"codelyzer": "^4.0.1",
6161
"jasmine-core": "^2.8.0",
6262
"jasmine-spec-reporter": "^4.2.1",
6363
"karma": "^1.7.1",

src/app/components/ai/ai.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit, OnDestroy } from '@angular/core';
22

33
import { Observable } from 'rxjs/Observable';
4-
import 'rxjs/add/operator/scan';
4+
import { scan } from 'rxjs/operators';
55

66
import { AiService } from '../../service/ai.service';
77
import { Message } from '../../model/message';
@@ -21,7 +21,9 @@ export class AiComponent implements OnInit, OnDestroy {
2121

2222
ngOnInit() {
2323
this.allMessages = this.ai.conversation.asObservable()
24-
.scan((acc, val) => acc.concat(val) );
24+
.pipe(
25+
scan((acc, val) => acc.concat(val))
26+
)
2527
}
2628

2729
ngOnDestroy() {
@@ -38,7 +40,7 @@ export class AiComponent implements OnInit, OnDestroy {
3840
.subscribe(
3941
(value) => {
4042
this.formInput = value;
41-
console.log(value);
43+
// console.log(value);
4244
},
4345
(err) => {
4446
console.log(err);
@@ -51,6 +53,6 @@ export class AiComponent implements OnInit, OnDestroy {
5153
// console.log("Talking complete");
5254
this.startTalkingToBot();
5355
});
56+
}
5457
}
55-
}
5658

src/app/service/ai.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ export class AiService {
5151
var transcript = result[0].transcript;
5252
if (result.isFinal) {
5353
if (result[0].confidence < 0.1) {
54-
console.log("Unrecognized result - Please try again");
54+
// console.log("Unrecognized result - Please try again");
5555
}
5656
else {
5757
sentence = lodash.trim(transcript);
58-
console.log("Did you said? -> " + sentence + " , If not then say something else...");
58+
// console.log("Did you said? -> " + sentence + " , If not then say something else...");
5959
}
6060
}
6161
}

0 commit comments

Comments
 (0)