售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Getting Started with Angular Second Edition
Getting Started with Angular Second Edition
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Get Going with Angular
Angular and semver
The evolution of the Web - time for a new framework
The evolution of ECMAScript
Web Components
Web Workers
Lessons learned from AngularJS in the wild
Controllers
Scope
Dependency injection
Server-side rendering
Applications that scale
Templates
Change detection
Summary
2. The Building Blocks of an Angular Application
A conceptual overview of Angular
Changing directives
Getting to know Angular components
Components in action
Components in Angular
Angular modules
Bootstrapping an Angular application
Pipes
Defining pipes
Improving change detection
Classical change detection
Change detection in AngularJS
In the zone.js
Simplified data flow
Enhancing AngularJS's change detection
Services
The new router
Angular route definition syntax
Summary
3. TypeScript Crash Course
Introduction to TypeScript
Compile-time type checking
Better support by text editors and IDEs
There's even more to TypeScript
Using TypeScript
Installing TypeScript with npm
Running our first TypeScript program
TypeScript syntax and features introduced by ES2015 and ES2016
ES2015 arrow functions
Using the ES2015 and ES2016 classes
Defining variables with block scope
Meta-programming with ES2016 decorators
Using configurable decorators
Writing modular code with ES2015
Using the ES2015 module syntax
Taking advantage of the modules' implicit asynchronous behavior
Using aliases
Importing all the module exports
Default exports
ES2015 module loader
ES2015 and ES2016 recap
Taking advantage of static typing
Using explicit type definitions
The type any
Understanding the Primitive types
The Enum types
Understanding the Object types
The Array types
The Function types
Defining classes
Using access modifiers
Defining interfaces
Interface inheritance
Implementing multiple interfaces
Further expressiveness with TypeScript decorators
Writing generic code by using type parameters
Using generic functions
Having multiple type parameters
Writing less verbose code with TypeScript's type inference
Best common type
Contextual type inference
Using ambient type definitions
Using predefined ambient type definitions
Custom ambient type definitions
Summary
4. Getting Started with Angular Components and Directives
The "Hello world!" application in Angular
Using TypeScript
Setting up our environment
Installing the sample project repository
Playing with Angular and TypeScript
Using Angular directives
The ngFor directive
Improved semantics of the directives syntax
Declaring variables inside a template
Using syntax sugar in templates
Defining Angular directives
Setting the directive's inputs
Understanding the directive's constructor
Better encapsulation of directives with NgModules
Using NgModules for declaring reusable components
Using custom element schema
Creating custom Angular components
Introducing the component's view encapsulation
Implementing the component's controllers
Handling user actions
Using inputs and outputs
Determining of the inputs and outputs
Defining the inputs and outputs
Passing inputs and consuming the outputs
Event bubbling
Renaming the inputs and outputs
An alternative syntax to define inputs and outputs
Explaining Angular's content projection
Basic content projection in Angular
Projecting multiple content chunks
Nesting components
Using ViewChildren and ContentChildren
ViewChild versus ContentChild
Hooking into the component's life cycle
Order of execution of the life cycle hooks
Defining generic views with TemplateRef
Understanding and enhancing the change detection
The order of execution of the change detectors
Understanding Angular's change detection strategies
Introducing immutable data structures and OnPush
Using immutable data in Angular
Summary
5. Dependency Injection in Angular
Why do I need DI?
DI in Angular
Benefits of DI
Configuring an injector
Dependency resolution with generated metadata
Instantiating an injector
Introducing forward references
Configuring providers
Using existing providers
Defining factories for instantiating services
Child injectors and visibility
Building a hierarchy of injectors
Configuring dependencies
Using the @Self decorator
Skipping the self injector
Having optional dependencies
Using multiproviders
Using DI with components and directives
Configuring DI with NgModules
Introducing the element injectors
Declaring providers for the element injectors
Exploring DI with components
viewProviders versus providers
Using Angular's DI with ES5
Summary
6. Working with the Angular Router and Forms
Developing the "Coders repository" application
Exploring the Angular router
Using PathLocationStrategy
Configuring routes
Using routerLink and router-outlet
Lazy-loading with loadChildren
Prefetching of lazy-loaded routes
RouterModule.forRoot versus RouterModule.forChild
Using Angular's forms module
Developing template-driven forms
Digging into the template-driven form's markup
Using the built-in validators
Defining custom validators
Using select inputs with Angular
Using the NgForm directive
Two-way data binding with Angular
Storing the form data
Listing all the stored data
Summary
7. Explaining Pipes and Communicating with RESTful Services
Developing model-driven forms in Angular
Using composition of control validators
Exploring the HTTP module of Angular
Using Angular's HTTP module
Defining parameterized views
Defining nested routes
Transforming data with pipes
Developing stateless pipes
Using Angular's built-in pipes
Developing stateful pipes
Using stateful pipes
Using Angular's AsyncPipe
Using AsyncPipe with observables
Summary
8. Tooling and Development Experience
Running an application in a Web Worker
Web Workers and Angular
Bootstrapping an application running in a Web Worker
Migrating an application to Web Worker
Making an application compatible with Web Workers
Initial load of a SPA
Initial load of a SPA with server-side rendering
Server-side rendering with Angular
Enhancing our development experience
Text editors and IDEs
Angular language service
Bootstrapping a project with angular-cli
Using angular-cli
Angular quick starters
Angular Seed
Angular 2 Webpack starter
AoT compilation in Angular
How code generation works
Introducing AoT compilation
Constraints of the AoT compilation
How to use the AoT compilation of Angular
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜