List of Listings

Chapter 2. Getting started with Angular

Listing 2.1. TypeScript index.html

Listing 2.2. TypeScript main.ts

Listing 2.3. ES5 index.html

Listing 2.4. ES5 main.js

Listing 2.5. ES6 index.html

Listing 2.6. ES6 main.js

Listing 2.7. index.html with SystemJS

Listing 2.8. package.json

Listing 2.9. Using package source code in package.json

Listing 2.10. index.html

Listing 2.11. systemjs.config.js

Listing 2.12. tsconfig.json

Listing 2.13. app.component.ts

Listing 2.14. app.module.ts

Listing 2.15. systemjs.config.js file

Listing 2.16. index.html

Listing 2.17. Updated app.module.ts

Listing 2.18. application.ts

Listing 2.19. application.html

Listing 2.20. product-item.ts

Listing 2.21. product-item.html

Listing 2.22. stars.ts

Listing 2.23. stars.html

Chapter 3. Navigation with the Angular router

Listing 3.1. HomeComponent

Listing 3.2. ProductDetailComponent

Listing 3.3. app.routing.ts

Listing 3.4. app.component.ts

Listing 3.5. main.ts

Listing 3.6. main-navigate.ts

Listing 3.7. ProductDetailComponentParam

Listing 3.8. main-param.ts

Listing 3.9. main-child.ts

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.15. main_aux.ts

Listing 3.16. luxury.model.ts

Listing 3.17. main-luxury.ts

Listing 3.18. main-luxury-lazy.ts

Listing 3.19. luxury.lazy.module.ts

Listing 3.20. product-detail.ts

Listing 3.21. home.ts

Listing 3.22. home.css

Listing 3.23. application.ts

Listing 3.24. application.html

Listing 3.25. product-item.ts

Listing 3.26. product-item.html

Listing 3.27. product-item.css

Listing 3.28. app.module.ts

Chapter 4. Dependency injection

Listing 4.1. main-basic.ts

Listing 4.2. product.ts

Listing 4.3. product-service.ts

Listing 4.4. main.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

Listing 4.11. Product and Review classes

Listing 4.12. ProductService class

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

Listing 5.6. temperature-pipe.ts

Listing 5.7. pipe-tester.ts

Listing 5.8. filter-pipe.ts

Listing 5.9. home.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.4. stock.ts

Listing 6.5. price-quoter.ts

Listing 6.6. mediator.ts

Listing 6.7. order.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.12. stars.ts

Listing 6.13. Revised stars.html

Listing 6.14. product-detail.html

Listing 6.15. product-detail.ts

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.9. FormControl

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

Listing 7.21. Adding validator directives

Listing 7.22. Updated app.module.ts file

Chapter 8. Interacting with servers using HTTP and WebSockets

Listing 8.1. hello_server.ts

Listing 8.2. tsconfig.json

Listing 8.3. my-express-server.ts

Listing 8.4. package.json

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.9. main-form.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

Listing 8.17. websocket-observable-service-subscriber.ts

Listing 8.18. two-way-websocket-client.html

Chapter 9. Unit-testing Angular applications

Listing 9.1. test.html

Listing 9.2. systemjs.config.js fragment

Listing 9.3. app.routing.ts

Listing 9.4. app.module.ts

Listing 9.5. app.spec.ts

Listing 9.6. weather.service.ts

Listing 9.7. weather.service.spec.ts

Listing 9.8. weather.ts

Listing 9.9. weather.spec.ts

Listing 9.10. karma.conf.js

Listing 9.11. karma-test-runner.js

Listing 9.12. auction-unit-tests.html

Listing 9.13. application.spec.ts

Listing 9.14. product-service.spec.ts

Listing 9.15. stars.spec.ts

Chapter 10. Bundling and deploying applications with Webpack

Listing 10.1. index.html

Listing 10.2. main.js

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

Listing 10.18. auction/client/webpack.test.config.js

Listing 10.19. auction/client/package.json

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.4. thisAndThat.html

Listing A.5. fatArrow.html

Listing A.6. rest.html

Listing A.7. spread.html

Listing A.8. getStockPrice()

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

Listing A.14. Using a promise

Listing A.15. Chaining promises

Listing A.16. shipping.js

Listing A.17. billing.js

Listing A.18. moduleLoader.html

Appendix B. TypeScript as a language for Angular applications

Listing B.1. tsconfig.json

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

Listing B.13. Using multiple interface implementations

Listing B.14. Callable interface with a bare function

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.235.225