Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Angular 2 Components

You're reading from   Angular 2 Components Practical and easy-to-follow guide to Angular 2 Components

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher Packt
ISBN-13 9781785882340
Length 124 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Templier Thierry Templier Thierry
Author Profile Icon Templier Thierry
Templier Thierry
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Angular 2 Component Architecture 2. Setting Up an Angular 2 Development Environment with angular-cli FREE CHAPTER 3. The TypeScript Primer 4. Building a Basic Component 5. Building Dynamic Components 6. Component Communication 7. Putting It All Together 8. Integrating Third-Party Components 9. Angular 2 Directives Index

Generating an Angular 2 project

The first command that we will use with angular-cli is new. This command will create a folder structure for our project and install all the required dependencies. Along with the basic Angular 2 files and modules, angular-cli will install modules for testing, linting, and documenting our code. This book is all about components, so we won't touch most of this stuff. You can read more about the available commands on the official angular-cli page: https://cli.angular.io/.

To generate a new project, follow these steps:

  1. Launch the Terminal (or command-line in Windows).
  2. Type ng new ng_components and press Enter.

The angular-cli software will generate a new project under the current directory:

Generating an Angular 2 project

Note that the last line prints: Installing packages for tooling via npm. The angular-cli tool will download all the required modules using standard npm command behind the scenes.

That's it! You just generated a complete Angular 2 project with everything you need already...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Angular 2 Components
You have been reading a chapter from
Angular 2 Components
Published in: Nov 2016
Publisher: Packt
ISBN-13: 9781785882340
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon