Starter Files for the Mastering Angular Series on WintellectNOW
This is a simple CRUD (create, read, update & delete) application starter project the Angular framework. The base project configuration was originally adapted from the Angular Webpack Starter project, and has been updated to Webpack 2 with help from this project Angular Class - Angular Webpack Stater.
Step 1. Install Node.js version 7 or higher. To install Node.js click here.
Step 2. Download this repository from here. Extract the zip file to a working folder on your system.
Step 3. Open a terminal window, change to the folder where you extracted the zip file. You should see a package.json file in the folder.
On Windows, the terminal is called “Node.js Command Prompt”. This will command prompt will contain the proper paths for Node.js development. DO NOT RUN the Node.js program. Click the icon named “Node.js Command Prompt”. For Mac users, the Mac terminal is all you need.
Step 4. From the terminal, run the following command:
$ npm i && npm start
It could take a few minutes for this command to complete. If you have connection issues due to a proxy server, please edit the .npmrc file per the instructions in those files. Then re-run the command above.
This set has been completed successfully when you receive the following message:
[0] Child html-webpack-plugin for "index.html":
[0] chunk {0} index.html 541 kB [entry] [rendered]
[0] [0] ./~/lodash/lodash.js 540 kB {0} [built]
[0] [1] (webpack)/buildin/global.js 509 bytes {0} [built]
[0] [2] (webpack)/buildin/module.js 517 bytes {0} [built]
[0] [3] ./~/html-webpack-plugin/lib/loader.js!./src/index.html 644 bytes {0} [built]
[0] webpack: Compiled successfully.
This terminal window is now running the web server, a second terminal window will need to be opened to run additional terminal commands.
Step 5. Open a web browser, and navigate to http://localhost:5000. The Angular web application should load and be usable.
To Modify the Web Application
Step 6. Open your favorite text editor (such as Atom or Visual Studio Code), and modify the files in the src folder. When file changes are saved, webpack will automatically transpile and bundle the application code and assets, and deploy it to the dist folder. To see the changes, reload your web browser.
The solution is preconfigured for IntelliJ IDEA and Webstorm for ESLint and TSLint. Also, automatic transpilation for TypeScript and SASS has been disabled. All transpilation should be performed via Webpack from the command line.
Visual Studio Code supports TypeScript out of the box, but several additional extensions will greatly enhance the development experience. Install the following extensions:
Atom does not support TypeScript out of the box. Please install the following packages to enhance the development experience. To install an extension from the menu bar, go to Packages -> Settings View -> Install Packages/Themes. Search for the following packages individually, and install them.
apm config set proxy "http://localhost:8080"
apm config set https_proxy "http://localhost:8080"
apm config set strict-ssl false
Restart Atom, then re-attempt to install the atom-typescript package again.
From a terminal run the following command:
npm test
The results of the unit tests and code coverage report will be displayed in the terminal window.
To view the HTML version of the code coverage report, open the index.html in the reports/coverage/browser-name folder with a web browser.
From a terminal, in the root project folder (where the package.json file exists), the following commands can be executed to perform various project development tasks.
To learn more about the Angular/WebPack/TypeScript/Karma configuration, click here.