Skip to content

roliveira-com/rango

Repository files navigation

Rango

Estudando Angular 4 com typescipt e Angular CLI!

Usando o HttpClient

Este branch encapsula o refactory para usar o Módulo HttpClient introduzido no Angular 4.3. Alterações foram necessárias no múdulo principal da aplicação (providers) e nas classes RestaurantService, OrderService e ErrorHandler.

Usando o HttpInterceptors

Este branch encapsula o refactory para o envio dos header atraves do HttpInterceptors. Alterações foram necessaŕias na classe OrderService e adição da classe interceptor AuthInterceptor

Angular 4 and Angular CLI

This project was generated with Angular CLI version 1.3.0.

Installing dependencies

Just run npm install

Development server

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. The local server use json-server library to setup a local REST api backend. Run node backend/dist/server at the root folder to start server.

Backend server while developing

While performing changes to the backend scripts, you can run nodemon --watch backend backend/dist/server.js and the server will reload automatically when you save the changes.

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.

Initializing server

ng serve or npm start

2. Initializing Backend

Installing json-server

npm install -g json-server

Initializing the backend server (at app root folder)

node backend/dist/server

Backend live-reload

While performing changes to the backend scripts, you can run nodemon --watch backend backend/dist/server.js and the server will reload automatically when you save the changes.

Goodies

Regex most used

Email Regex

/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i

Number Regex

/^[0-9]*$/

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.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor. Before running the tests make sure you are serving the app via ng serve.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Credits

About

Mini aplicação para estudar Angular 4, Typescript e PWA. No futuro se torne um app de pedido de comida tipo ifood. Ou não.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors