Skip to content

Commit

Permalink
how to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mlabouardy committed Jan 4, 2018
1 parent 36bfe21 commit 43159f9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 24 deletions.
28 changes: 8 additions & 20 deletions README.md
@@ -1,27 +1,15 @@
# Angulardemo2
# SmartBot

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.1.
ChatBot with Angular 5 & DialogFlow [demo](http://smartbot-mlabouardy.s3-website-us-east-1.amazonaws.com)

## Development server
## Run

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
```
ng serve
```

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
* Make sure to update the environments/environment.ts with your own DialogFlow Client Access Token.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
[Tutorial](http://www.blog.labouardy.com/serverless-chatbot-angular-5-dialogflow-aws-lambda/).
2 changes: 1 addition & 1 deletion src/app/components/message-form/message-form.component.ts
Expand Up @@ -26,7 +26,7 @@ export class MessageFormComponent implements OnInit {

this.dialogFlowService.getResponse(this.message.content).subscribe(res => {
this.messages.push(
new Message(res.result.speech, 'assets/images/bot.png', res.timestamp)
new Message(res.result.fulfillment.speech, 'assets/images/bot.png', res.timestamp)
);
});

Expand Down
@@ -1,4 +1,4 @@
.chatlist{
max-height: 600px;
height: 600px;
overflow-y: scroll;
}
2 changes: 1 addition & 1 deletion src/app/services/dialogflow.service.ts
Expand Up @@ -7,7 +7,7 @@ import { environment } from '@env/environment';
@Injectable()
export class DialogflowService {

private baseURL: string = "https://api.dialogflow.com/v1/query";
private baseURL: string = "https://api.dialogflow.com/v1/query?v=20150910";
private token: string = environment.token;

constructor(private http: Http){}
Expand Down
3 changes: 2 additions & 1 deletion src/environments/environment.prod.ts
@@ -1,3 +1,4 @@
export const environment = {
production: true
production: true,
token: ''
};

0 comments on commit 43159f9

Please sign in to comment.