Skip to content

Code samples from the book Angular 2 Development with TypeScript

License

Notifications You must be signed in to change notification settings

niejn/angular2typescript

 
 

Repository files navigation

This is a repository for code samples for the book by Yakov Fain and Anton Moiseev Angular 2 Development with TypeScript.

Besides the original code samples (they work with Angular 2.4) we created an Angular 4 versions of the most code samples (these projects were generated by Angular CLI 1.0.1).

NOTE: The folder extras has some apps that use Angular Material 2 and PrimeNG libraries. It also has additional code samples illustrating various TypeScript features.

Reporting errors: If you'll run into a bug in the code, please open an issue here. If you want to report errors or typos in the book text, please report it at the book's forum in the Errata section. We started reading all submissions and created an Errata page with corrections here: http://bit.ly/2nrJXLe.

The video with a code review of a sample online auction application that we gradually develop in the book is located at https://youtu.be/I809tajbVk4.

Watch the video from one of our recent online trainings: https://www.youtube.com/watch?v=47Gn-jgb0FI&feature=youtu.be It'll help you in getting started while reading Chapter 2.

To request on-site training in your organization send us an email at training@faratasystems.com.

The Angular CLI version of the projects

After the book was published we've created additional versions of book samples using Angular-CLI generated projects (see this video https://www.youtube.com/watch?time_continue=1&v=VKQEN7IyanU). These code samples are located in the directory Angular4, which has several subdirectories. Each of those is an Angular CLI project with several sample applications. Each of these applications has a bootstrap file with the name that starts with main (see the src directory).

To run any of these applications, change into the required directory and run npm install. The file .angular-cli.json may configure one or more apps. If there only one app configured per project (default), modify the property main in the file .angular-cli.json to point at the bootstrap file you want to run. After that, run ng serve and open your browser at localhost:4200.

If several apps are configured in .angular-cli.json project (as in the project inter-component), run a specific app by name. For example, the project inter-component has an app main-mediator-parent.ts, which is configured in .angular-cli.json as mediator1. You can run it with the following command:

ng serve --app mediator1 -o

Code samples located in the folders http-node-samples and auction require two separate terminal windows: one for running the Node server and another - to bundle and deploy the client. In the client dir: npm run build. In the server dir: npm run devRestAngular (in auction/server it's npm run startServer). Then open your browser at localhost:8000.

The folder test-weather contains a sample app from chapter 9. Run the unit tests with ng test.

About

Code samples from the book Angular 2 Development with TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.3%
  • TypeScript 15.1%
  • HTML 4.3%
  • CSS 0.3%