Book Image

Angular UI Development with PrimeNG

By : Sudheer Jonna, Oleg Varaksin
Book Image

Angular UI Development with PrimeNG

By: Sudheer Jonna, Oleg Varaksin

Overview of this book

PrimeNG is a leading UI component library for Angular applications with 80+ rich UI components. PrimeNG was a huge success in the Angular world and very quickly. It is a rapidly evolving library that is aligned with the last Angular release. In comparison with competitors, PrimeNG was created with enterprise applications in mind. This book provides a head-start to help readers develop real–world, single-page applications using the popular development stack. This book consists of 10 chapters and starts with a short introduction to single-page applications. TypeScript and Angular fundamentals are important first steps for subsequent PrimeNG topics. Later we discuss how to set up and configure a PrimeNG application in different ways as a kick-start. Once the environment is ready then it is time to learn PrimeNG development, starting from theming concepts and responsive layouts. Readers will learn enhanced input, select, button components followed by the various panels, data iteration, overlays, messages and menu components. The validation of form elements will be covered too. An extra chapter demonstrates how to create map and chart components for real-world applications. Apart from built-in UI components and their features, the readers will learn how to customize components to meet their requirements. Miscellaneous use cases are discussed in a separate chapter, including: file uploading, drag and drop, blocking page pieces during AJAX calls, CRUD sample implementations, and more. This chapter goes beyond common topics, implements a custom component, and discusses a popular state management with @ngrx/store. The final chapter describes unit and end-to-end testing. To make sure Angular and PrimeNG development are flawless, we explain full-fledged testing frameworks with systematic examples. Tips for speeding up unit testing and debugging Angular applications end this book. The book is also focused on how to avoid some common pitfalls, and shows best practices with tips and tricks for efficient Angular and PrimeNG development. At the end of this book, the readers will know the ins and outs of how to use PrimeNG in Angular applications and will be ready to create real- world Angular applications using rich PrimeNG components.
Table of Contents (11 chapters)

What this book covers

Chapter 1, Getting Started with Angular and PrimeNG, gives you the knowledge you need to dive into the next chapters. The chapter gives an overview of the TypeScript and Angular constructs used in this book. It is not possible to explain numerous features in detail. Instead, we will concentrate on the most important key concepts such as types, template syntax, decorators, component communication scenarios, modularity, and lifecycle hooks. After that, this chapter will introduce PrimeNG, which consists of rich UI components for Angular 2+, and show three possible project setups using SystemJS and Webpack loaders, as well as Angular CLI, a command-line tool for blazing fast Angular development.

Chapter 2, Theming Concepts and Layouts, introduces PrimeNG themes and the concepts involved. Readers will learn about the theming of PrimeNG components. The difference between structural and skinning CSS, the recommended project structure when working with SASS, installing and customizing PrimeNG themes and creating new themes will all be detailed. A discussions of two variants of responsive layouts, PrimeNG's own grid system, and Bootstrap's flexbox grid, finish this chapter.

Chapter 3, Enhanced Inputs and Selects, explains how to work with the input and select components available in PrimeNG. Such components are the main parts of every web application. PrimeNG provides nearly 20 components for data input that extend the native HTML elements with user-friendly interfaces, skinning capabilities, validation, and many other useful features.

Chapter 4, Button and Panel Components, covers various buttons such as radio, split, toggle, and select buttons, and Panel components, such as Toolbar, Accordion, FieldSet, and tabbed view. Panel components act as container components, which allow the grouping of other components. Various settings to configure Panel components are detailed in this chapter.

Chapter 5, Data Iteration Components, covers basic and advanced features to visualize data with the data iteration components provided by PrimeNG, including DataTable, DataList, PickList, OrderList, Tree, and TreeTable. The features discussed include sorting, pagination, filtering, lazy loading, and single and multiple selections. Advanced data visualization with the Schedule and DataScroller components will be demonstrated as well.

Chapter 6, Amazing Overlays and Messages, demonstrates a range of variations in content, displaying in modal or non-modal overlays such as Dialog, LightBox, and Overlay panel. The user does not leave the page flow when the content is displayed in the mentioned Overlays. An Overlay component overlays other components on a page. PrimeNG also offers notification components to show any messages or advisory information. Those components will be described as well.


Chapter 7, Endless Menu Variations, explains several menu variations. PrimeNG's menus fulfill all major requirements. They come with various facets--static, dynamic, tiered, hybrid, iPod-styled, and so on, and leave nothing to be desired. Readers will see a lot of recipes that discuss menu structure, configuration options, customizations, and integration with other components.

Chapter 8, Creating Charts and Maps, covers the ways to create visual charts with PrimeNG's extensive charting features and maps based on Google Maps. PrimeNG offers basic and advanced charting with its easy-to-use and user-friendly charting infrastructure. Besides standard charts, the chapter shows a special organization chart for visualizing hierarchical data. Throughout the chapter, mapping abilities such as drawing polylines, polygons, handling markers, and events will be explained as well.

Chapter 9, Miscellaneous Use Cases and Best Practices, introduces more interesting features of the PrimeNG library. You will learn about file uploading, drag and drop capabilities, displaying collections of images, practical CRUD implementation, deferred page loading, blocking page pieces, displaying a confirmation dialog with guarded routes, and more. An extra section will go through the complete process of building reusable components and developing a custom wizard component. After reading this chapter, readers will be aware of state-of-the-art state management with @ngrx/store and will see the benefits of Redux architecture.

Chapter 10, Creating Robust Applications, describes unit and end-to-end testing. The chapter begins with setting up a test environment with Jasmine and Karma. To make sure Angular and PrimeNG development is flawless, full-fledged testing frameworks will be explained with systematic examples. Tips for speeding up testing and debugging Angular applications end this chapter.