Base on experiences at companies providing Logistic services, I am trying to make neat, tidy, user friendly app following the mental mapping
ng test --include='**/dealer.service.spec.ts'
or
ng test --main src/app/products/product-shell/product-shell.component.spec.ts
x Starter files with no NgRx added.
This project was generated with Angular CLI version 9.1.3.
Here are some VSCode snippets I'm using whilst recording this application, these help speed up boilerplate creation for things such as components, modules and services.
Here's how to install the snippets in VSCode. Add them to
typescript.json
when prompted for which language the snippets are for.
{
"@Component": {
"prefix": "@Component",
"description": "Creates a component definition",
"body": [
"import { Component } from '@angular/core';",
"",
"@Component({",
"\tselector: '${1:selector-name}',",
"\tstyleUrls: ['${1:selector-name}.component.scss'],",
"\ttemplate: `",
"\t\t<div>",
"\t\t\t",
"\t\t</div>",
"\t`",
"})",
"export class ${3:Name}Component {",
"\tconstructor() {}",
"}"
]
},
"@Injectable": {
"prefix": "@Injectable",
"description": "Creates an @Injectable service",
"body": [
"import { Injectable } from '@angular/core';",
"",
"@Injectable()",
"export class ${1:Name}Service {",
"\tconstructor() {}",
"}"
]
},
"@NgModule": {
"prefix": "@NgModule",
"description": "Creates an @NgModule",
"body": [
"import { NgModule } from '@angular/core';",
"",
"@NgModule({",
"\timports: [],",
"\tdeclarations: [],",
"\tproviders: []",
"})",
"export class ${1:Name}Module {}"
]
},
"@Pipe": {
"prefix": "@Pipe",
"description": "Creates an @Pipe",
"body": [
"import { Pipe, PipeTransform } from '@angular/core';",
"",
"@Pipe({",
"\tname: '${1:selector-name}'",
"})",
"export class ${2:Name}Pipe implements PipeTransform {",
"\ttransform(value: any) {",
"\t\t$0",
"\t}",
"}"
]
}
}
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.