This project serves as the front end for TTT project
- A front end which accepts a number input N with a Submit button (Angular 4)
- On entering a value and pressing submit, a request is sent to a node based backend link
- The backend fetches a file hosted at http://terriblytinytales.com/test.txt and returns the top N most frequently occurring words in this file.
- The retrieved data (the top N words and their frequency of occurrence) is then displayed, in a tabular format.
This project was generated with Angular CLI version 1.5.4.
The angular front-end broadly consists of two components (one is the form which accepts the input and the second one is the table).
- input component
- table component
Used http module (angular) to make a post request to the backend server (Hard-coded to run at localhost:3000) (Blah) Alternatively could have used an XHR request (look for commented code)
Rest is kinda self explainatory
Clone this repo locally and run npm-install once to install required node modules. (You should have angular CLI installed to run this project)
With the backend server listening at 3000, a simple ng serve should start serving the front-end at localhost:4200
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.
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
.
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.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.