Chapter 2. Getting started with Angular
Listing 2.1. TypeScript index.html
Listing 2.2. TypeScript main.ts
Listing 2.7. index.html with SystemJS
Listing 2.9. Using package source code in package.json
Listing 2.11. systemjs.config.js
Listing 2.13. app.component.ts
Listing 2.15. systemjs.config.js file
Listing 2.17. Updated app.module.ts
Listing 2.19. application.html
Chapter 3. Navigation with the Angular router
Listing 3.2. ProductDetailComponent
Listing 3.7. ProductDetailComponentParam
Listing 3.10. ProductDetailComponent
Listing 3.11. ProductDescriptionComponent
Listing 3.12. SellerInfoComponent
Listing 3.13. LoginGuard class
Listing 3.14. main-with-guard.ts
Listing 3.18. main-luxury-lazy.ts
Listing 3.19. luxury.lazy.module.ts
Listing 3.20. product-detail.ts
Listing 3.24. application.html
Listing 3.26. product-item.html
Chapter 4. Dependency injection
Listing 4.3. product-service.ts
Listing 4.5. Specifying a factory function as a provider
Listing 4.6. Specifying the environment’s value provider
Listing 4.7. Using OpaqueToken instead of a string
Listing 4.8. Modifications in app.module.ts
Listing 4.9. Modifications in product-detail.ts
Listing 4.10. product-detail.html
Chapter 5. Bindings, observables, and pipes
Listing 5.1. attribute-vs-property.ts
Listing 5.2. template-binding.ts
Listing 5.3. two-way-binding.ts
Listing 5.4. observable-events.ts
Listing 5.5. observable-events-http.ts
Chapter 6. Implementing component communications
Listing 6.1. input_property_binding.ts
Listing 6.2. Adding the setter and getter
Listing 6.3. output-property-binding.ts
Listing 6.8. basic-ng-content.ts
Listing 6.9. ng-content-selector.ts
Listing 6.10. ng-onchanges-with-param.ts
Listing 6.11. exposing-child-api.ts
Listing 6.13. Revised stars.html
Chapter 7. Working with forms
Listing 7.1. Plain HTML user registration form
Listing 7.2. Angular-aware form
Listing 7.3. Modified username and ssn fields
Listing 7.4. Modified password fields
Listing 7.5. HTML form component
Listing 7.6. Form model to use with formGroupName
Listing 7.7. formGroup template
Listing 7.8. Completed formGroup template
Listing 7.10. 02_growable-items-form.ts file: defining the model
Listing 7.11. 02_growable-items-form.ts file: template
Listing 7.12. Defining a form model
Listing 7.13. HTML binding to the model
Listing 7.14. Refactoring formModel with FormBuilder
Listing 7.15. Modified form model
Listing 7.16. Modified template
Listing 7.17. Async SSN validator
Listing 7.18. SsnValidatorDirective
Listing 7.19. Registration form validation template
Listing 7.20. Checking form validation
Chapter 8. Interacting with servers using HTTP and WebSockets
Listing 8.3. my-express-server.ts
Listing 8.5. auction-rest-server.ts
Listing 8.6. Modified package.json file
Listing 8.7. client/app/main.ts
Listing 8.8. main-asyncpipe.ts
Listing 8.10. product-service.ts
Listing 8.11. main-with-service.ts
Listing 8.12. simple-websocket-server.ts
Listing 8.13. simple-websocket-client.html
Listing 8.14. custom-observable-service.ts
Listing 8.15. custom-observable-service-subscriber.ts
Listing 8.16. websocket-observable-service.ts
Chapter 9. Unit-testing Angular applications
Listing 9.2. systemjs.config.js fragment
Listing 9.6. weather.service.ts
Listing 9.7. weather.service.spec.ts
Listing 9.11. karma-test-runner.js
Listing 9.12. auction-unit-tests.html
Listing 9.13. application.spec.ts
Chapter 10. Bundling and deploying applications with Webpack
Listing 10.3. webpack.config.js
Listing 10.4. hello-world-devserver/index.html
Listing 10.5. hello-world-devserver/package.json
Listing 10.6. hello-world-devserver/webpack.config.js
Listing 10.7. basic-webpack-starter/vendor.ts
Listing 10.8. basic-webpack-starter/webpack.config.js
Listing 10.9. basic-webpack-starter/package.json
Listing 10.10. basic-webpack-starter/index.html
Listing 10.11. angular2-webpack-starter/webpack.config.js
Listing 10.12. angular2-webpack-starter/webpack.prod.config.js
Listing 10.13. angular2-webpack-starter/package.json
Listing 10.14. angular2-webpack-starter/typings.d.ts
Listing 10.15. auction/package.json
Listing 10.16. auction/client/karma.conf.js
Listing 10.17. auction/client/karma-test-runner.js
Appendix A. An overview of ECMAScript 6
Listing A.1. Printing a currency amount
Listing A.2. Hoisting a variable declaration
Listing A.3. Variables with block scoping
Listing A.9. Invoking getStockPrice()
Listing A.10. Destructuring an object
Listing A.11. Destructuring a nested object
Listing A.12. super() and super
Listing A.13. Nested callback functions
Appendix B. TypeScript as a language for Angular applications
Listing B.2. Calculating tax in JavaScript
Listing B.3. Calculating tax in TypeScript
Listing B.4. Calculating tax in TypeScript, modified
Listing B.5. Using an arrow-function expression
Listing B.6. Using a private property
Listing B.7. Using access modifiers
Listing B.8. Creating a method
Listing B.9. Adding a setter and a getter
Listing B.10. Using inheritance
Listing B.11. Using a generic type
Listing B.12. Declaring an interface
3.15.235.225