Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Angular UI Development with PrimeNG

You're reading from   Angular UI Development with PrimeNG Build rich UI for Angular applications using PrimeNG

Arrow left icon
Product type Paperback
Published in Jul 2017
Publisher Packt
ISBN-13 9781788299572
Length 384 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Sudheer Jonna Sudheer Jonna
Author Profile Icon Sudheer Jonna
Sudheer Jonna
Oleg Varaksin Oleg Varaksin
Author Profile Icon Oleg Varaksin
Oleg Varaksin
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Started with Angular and PrimeNG 2. Theming Concepts and Layouts FREE CHAPTER 3. Enhanced Inputs and Selects 4. Button and Panel Components 5. Data Iteration Components 6. Amazing Overlays and Messages 7. Endless Menu Variations 8. Creating Charts and Maps 9. Miscellaneous Use Cases and Best Practices 10. Creating Robust Applications

Summary

After reading this chapter, you got an overview of TypeScript and Angular concepts you need to understand for the upcoming chapters. TypeScript introduces types which help to recognize errors at development time. There are primitive types, types known from object-oriented programming languages, custom types, and so on. By default, TypeScript compiler always emits an JavaScript code, even in the presence of type errors. In this way, you can quickly migrate any existing JavaScript code to TypeScript just by renaming .js file to .ts without having to fix all compilation errors at once.

A typically Angular application is written in TypeScript. Angular provides a component-based approach which decouples your UI logic from the application (business) logic. It implements a powerful dependency injection system that makes reusing services a breeze. Dependency injection also increases the code testability because you can easily mock your business logic. An Angular application consists of hierarchical components, which communicate with each other in various ways such as @Input, @Output properties, shared services, local variables, and so on.

Angular is a modular framework. Module classes annotated with @NgModule provide a great way to keep the code clean and organized. Angular is flexible--lifecycle hooks allow us to perform custom logic at several stages in the in the component's life. Last but not least, it is fast due to smart change detection algorithm. Angular doesn't offer any rich UI components. It is just a platform for developing single page applications. You need a third-party library to create rich UI interfaces.

PrimeNG is a collection of such rich UI components for Angular 2+. In comparison with competitors, PrimeNG was created for enterprise applications and provides 80+ components. Adding PrimeNG dependencies is easy done. You only need to add PrimeNG and FontAwesome dependencies to the package.json file, and three CSS files: primeng.min.css, font-awesome.min.css, and theme.css for any theme you like. The next chapter will cover the theming concept in detail.

An Angular and PrimeNG application consists of ES6 (ECMAScript 2015) modules. Modules can be exported and imported. All modules in an application build a dependency graph. Therefore, you need a specific tool to resolve such modules starting at some entry point(s) and to output a bundle. There are some tools doing this and other tasks such as loading modules on demand, and similar.

In this chapter, SystemJS and Webpack loaders were discussed. SystemJS is only recommended for demo applications for the purpose of learning. Webpack-based builds are more sophisticated. Webpack has a combination of loaders for every file type and plugins. Plugins include useful behaviors into the Webpack build process, for example, creating common chunks, minification of web resources, copying files and directories, creating SVG sprites, and more. To quickly start the development in TypeScript and Angular, generate your projects with Angular CLI. This is a scaffolding tool, which makes it easy to create an application that works out of the box.

lock icon The rest of the chapter is locked
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 $19.99/month. Cancel anytime