angular-ts-basic-training


Project maintained by simon-an Hosted on GitHub Pages — Theme by mattgraham

Chapter 2

Exercise 2.1

Setup Angular CLI and create and start your Angular App

# Install the Angular CLI
npm i -g @angular/cli
# create a new angular project
ng new ngx-safe --routing --style scss

# Change to the directory containing your Angular App
cd ngx-safe

# Start your Angular App using angular cli
ng serve --open
# Start your Angular App using npm start commmand from package.json
# and passthrough --open command to angular cli.
npm start -- --open

Path to your Angular App: http://localhost:4200/

Exercise 2.2

Configure your app

Adjust app prefixes

Exercise 2.3

Add .prettierrc file

{
  "printWidth": 120,
  "singleQuote": true,
  "useTabs": false,
  "tabWidth": 2,
  "semi": true,
  "bracketSpacing": true,
  "trailingComma": "all"
}

tsconfig.json

"compilerOptions": {
  ...
  "baseUrl": "./src",
  "paths": {
    "~core/*": ["app/core/*"],
    "~safe/*": ["app/safe/*"],
    "~layout/*": ["app/layout/*"],
    "~store/*": ["app/store/*"]
  }
  ...
}

Next