Learning Angular: A Hands-On Guide to Angular 2 and Angular 4

Learning Angular: A Hands-On Guide to Angular 2 and Angular 4

Paperback

$35.99 $39.99 Save 10% Current price is $35.99, Original price is $39.99. You Save 10%.
View All Available Formats & Editions
Choose Expedited Shipping at checkout for guaranteed delivery by Monday, January 21

Product Details

ISBN-13: 9780134576978
Publisher: Addison-Wesley
Publication date: 10/12/2017
Series: Learning Series
Pages: 240
Sales rank: 1,226,757
Product dimensions: 7.00(w) x 8.90(h) x 0.60(d)

About the Author

Brad Dayley is a senior software engineer with more than 20 years of experience developing enterprise applications and web interfaces. He has used JavaScript and jQuery for years and is the author of Node.JS, MongoDB and Angular Web Development; jQuery and JavaScript Phrasebook; and Sams Teach Yourself AngularJS, JavaScript, and jQuery All in One. He has designed and implemented a wide array of applications and services, from application servers to complex web applications.

Brendan Dayley is a web application developer who loves learning and implementing the latest and greatest technologies. He is the co-author of Sams Teach Yourself AngularJS, JavaScript, and jQuery All in One and Node.JS, MongoDB and Angular Web Development. He has written a number of web applications using JavaScript, TypeScript, and Angular, and he is exploring the capabilities of new web and mobile technologies such as augmented reality and how to use them for innovative solutions.

Caleb Dayley is a university student who is studying computer science. Introduced to software development at a young age, he has taught himself much of what he knows about computer programming. He is a developer in JavaScript, Python, and C#, and is a big fan of the Unity platform. He is also the co-author of Node.JS, MongoDB and Angular Web Development. He is excited for what the future holds, and the opportunities to help design and create the next generation of innovative software that will continue to improve the way we live, work, and play

Table of Contents

Introduction 1
Chapter 1 Jumping into JavaScript 5
Setting Up a JavaScript Development Environment 5
Defining Variables 6
Understanding JavaScript Data Types 6
Using Operators 8
Arithmetic Operators 8
Assignment Operators 8
Applying Comparison and Conditional Operators 9
Implementing Looping 11
while Loops 11
do/while Loops 12
for Loops 12
for/in Loops 13
Interrupting Loops 13
Creating Functions 14
Defining Functions 14
Passing Variables to Functions 15
Returning Values from Functions 15
Using Anonymous Functions 16
Understanding Variable Scope 16
Using JavaScript Objects 17
Using Object Syntax 17
Creating Custom Defined Objects 18
Using a Prototyping Object Pattern 19
Manipulating Strings 19
Combining Strings 21
Searching a String for a Substring 21
Replacing a Word in a String 22
Splitting a String into an Array 22
Working with Arrays 22
Combining Arrays 24
Iterating Through Arrays 24
Converting an Array into a String 24
Checking Whether an Array Contains an Item 25
Adding Items to and Removing Items from Arrays 25
Adding Error Handling 25
try/catch Blocks 26
Throwing Your Own Errors 26
Using finally 27
Chapter 2 Jumping into TypeScript 29
Learning the Different Types 29
Understanding Interfaces 31
Implementing Classes 32
Class Inheritance 33
Implementing Modules 33
Understanding Functions 34
Chapter 3 Getting Started with Angular 37
Why Angular? 37
Understanding Angular 37
Modules 38
Directives 38
Data Binding 38
Dependency Injection 38
Services 39
Separation of Responsibilities 39
Adding Angular to Your Environment 39
Using the Angular CLI 40
Generating Content with the CLI 40
Creating a Basic Angular Application 41
Creating Your First Angular App 42
Understanding and Using NgModule 43
Creating the Angular Bootstrapper 44
Chapter 4 Angular Components 49
Component Configuration 49
Defining a Selector 50
Building a Template 50
Using Inline CSS and HTML in Angular Applications 51
Using Constructors 53
Using External Templates 54
Injecting Directives 56
Building a Nested Component with Dependency Injection 56
Passing in Data with Dependency Injection 58
Creating an Angular Application that Uses Inputs 59
Chapter 5 Expressions 61
Using Expressions 61
Using Basic Expressions 62
Interacting with the Component Class in Expressions 64
Using TypeScript in Angular Expressions 65
Using Pipes 68
Using Built-in Pipes 69
Using Built-in Pipes 71
Building a Custom Pipe 72
Creating a Custom Pipe 73
Chapter 6 Data Binding 75
Understanding Data Binding 75
Interpolation 76
Property Binding 77
Attribute Binding 78
Class Binding 79
Style Binding 81
Event Binding 82
Two-Way Binding 85
Chapter 7 Built-in Directives 87
Understanding Directives 87
Using Built-in Directives 87
Components Directives 88
Structural Directives 88
Attribute Directives 91
Chapter 8 Custom Directives 95
Creating a Custom Attribute Directive 95
Creating a Custom Directive with a Component 98
Chapter 9 Events and Change Detection 103
Using Browser Events 103
Emitting Custom Events 104
Emitting a Custom Event to the Parent Component Hierarchy 104
Handling Custom Events with a Listener 104
Implementing Custom Events in Nested Components 104
Deleting Data in a Parent Component from a Child Component 107
Using Observables 110
Creating an Observable Object 110
Watching for Data Changes with Observables 111
Chapter 10 Implementing Angular Services in Web Applications 115
Understanding Angular Services 115
Using the Built-in Services 115
Sending HTTP GET and PUT Requests with the http Service 116
Configuring the HTTP Request 117
Implementing the HTTP Response Callback Functions 117
Implementing a Simple JSON File and Using the http Service to Access It 118
Implementing a Simple Mock Server Using the http Service 121
Implementing a Simple Mock Server and Using the http Service to Update Items on the Server 127
Changing Views with the router Service 132
Using routes in Angular 134
Implementing a Simple Router 134
Implementing a Router with a Navigation Bar 138
Implementing a Router with Parameters 143
Chapter 11 Creating Your Own Custom Angular Services 149
Integrating Custom Services into Angular Applications 149
Adding an Angular Service to an Application 150
Implementing a Simple Application that Uses a Constant Data Service 151
Implementing a Data Transform Service 152
Implementing a Variable Data Service 156
Implementing a Service that Returns a Promise 161
Implementing a Shared Service 162
Chapter 12 Having Fun with Angular 171
Implementing an Angular Application that Uses the Animation Service 171
Implementing an Angular Application that Zooms in on Images 176
Implementing an Angular Application that Enables Drag and Drop 179
Implementing a Star Rating Angular Component 185
Index 195

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews