This project was generated with Angular CLI version 6.1.2.
- Angular-cli >= 6.1.x
- Typescript >= 3.0.3
- Node latest version
- Json-server
- Run
npm i -g json-server - Run
npm iornpm install. Navigate tohttp://localhost:9000to see fake api restful - Run
json-server --watch db.json --port 9000 - Run
ng servefor a dev server. Navigate tohttp://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.
app |
| auth | --module to authentication
| interceptor --all request and errors interceptos
| guard --all router guards
| service -- all services to auth
| core.module.ts -- imported ONLY in root module! This module are a Singleton DO NOT import in another module
| core |
| interceptor --all request and errors interceptos
| data-service --all services who make requests to server (where
| AbstractService --all services must to extends this abstract class
| service --all services where do not make requests to server
| core.module.ts -- imported ONLY in root module! This module are a Singleton DO NOT import in another module
| layout
| app-loader -- spinner when page load
| footer
| navbar
| model --all models
| shared
| component --all shared components
| pipe --all shared pipes
| directive --all shared directives
| shared.module.ts --import in your module, this contain all modules where you are need
| static-page | --module to static pages
| app.module.ts --root module
| app-routing.module --root routes module
| module.import.guard --throw exception where singleton modules are imported inside multiples modules
| shared |
| component
| dialog
inside your component Typescript
constructor(private dialog: MatDialog){}
openDialog(title: string, message: string, confirmBtn: string) {
const dialog = this.dialog.open(DialogComponent, {
width: '250px',
data: {title: title, message: message, confirmButton: confirmBtn}
});
dialog.afterClosed().subscribe(result => {
});
}inside result you can take result from the user