angular

A 2-post collection

Angular 2: Application Settings using the CLI Environment Option

Application wide settings can be a long conversation when starting a new application. Here are just a few questions when some of my teams started this conversation: Do we use ENV variables? What about manual bootstrap? Configuration files? Should we get them from the server? Using angular-cli & environment.ts The new angular-cli have the concept of different environments like development (dev) and production (prod). When creating a new application with the cli ng my-app and /environments folder is a part of the scaffold which contains the environment files. . ├── environment.ts ├── environment.prod.ts . . and then within the /src/app folder is and environment.ts file. Here are the contents: export const environment = { production: false }; As you might imagine, the...


Angular 2 : Getting off the Starting Line

The Angular team created a quickstart repo over at https://github.com/angular/quickstart which is a great starter project template for basically a "Hello World" application. It provides: lite-server, which is a demo or local/development only server basic tests using karma typescript dependencies (tsconfig, typings) Getting started is included in the README, but it's simple # clone the repo git clone https://github.com/angular/quickstart <your app name> # change directory to your app name cd <your app name> # delete the .git file to remove the binding from the angular repo rm -rf .git Now the code is set for you to create your own repo, git init, commit etc. Running the quickstart First make...