Giter VIP home page Giter VIP logo

angular-projects-second-edition's Introduction

Angular Projects - Second Edition

Angular Projects - Second Edition

This is the code repository for Angular Projects - Second Edition, published by Packt.

Build modern web apps by exploring Angular 12 with ten different projects and cutting-edge technologies

What is this book about?

Angular is a popular JavaScript framework that can run on a broad range of platforms including web, desktop, and mobile. It has an array of rich features right out of the box and a wide range of tools that makes it popular among developers. This updated second edition of Angular Projects will teach you how to build efficient and optimized web applications using Angular. You will start by exploring the essential features of the framework by creating ten different real-world web applications. Each application will demonstrate how to integrate Angular with a different library and tool. As you advance, you will understand how to implement popular technologies such as Angular Router, Scully, Electron, Angular service worker, Nx monorepo tools, NgRx, and more while building an issue tracking system, a PWA weather application, a mobile photo geotagging application, a component UI library, and many other exciting projects. Toward the concluding chapters, you’ll get to grips with customizing Angular CLI commands using schematics. By the end of this book, you will have the skills you need to be able to build Angular apps using a variety of different technologies according to your or your client’s needs.

This book covers the following exciting features:

  • Set up Angular applications using Angular CLI and Nx Console
  • Create a personal blog with Jamstack and SPA techniques
  • Build desktop applications with Angular and Electron
  • Enhance user experience (UX) in offline mode with PWA techniques
  • Make web pages SEO-friendly with server-side rendering
  • Create a monorepo application using Nx tools and NgRx for state management
  • Focus on mobile application development using Ionic
  • Develop custom schematics by extending Angular CLI

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

if (test expression)
{
  Statement upon condition is true
}

Following is what you need for this book: If you are a developer who has beginner-level experience with Angular and are looking to become well-versed with essential tools and deal with the various use cases you may encounter with Angular, then this Angular development book is for you. Beginner-level knowledge of web application development and basic experience working with ES6 or TypeScript are assumed.

With the following software and hardware list you can run all code files present in the book (Chapter 1-10).

Software and Hardware List

Chapter Software required OS required
1 to 10 Angular 12 Windows, Mac OS X, and Linux (Any)
1 to 10 VSCode Windows, Mac OS X, and Linux (Any)
1 to 10 Scully Windows, Mac OS X, and Linux (Any)
1 to 10 Clarity Design Windows, Mac OS X, and Linux (Any)
1 to 10 Angular PWA Windows, Mac OS X, and Linux (Any)
1 to 10 Electron Windows, Mac OS X, and Linux (Any)
1 to 10 Ionic Windows, Mac OS X, and Linux (Any)
1 to 10 CesiumJS Windows, Mac OS X, and Linux (Any)
1 to 10 Firebase Windows, Mac OS X, and Linux (Any)
1 to 10 GitHub API Windows, Mac OS X, and Linux (Any)
1 to 10 Nx monorepo tools Windows, Mac OS X, and Linux (Any)
1 to 10 NgRx Windows, Mac OS X, and Linux (Any)
1 to 10 Angular Material Windows, Mac OS X, and Linux (Any)
1 to 10 Angular CDK Windows, Mac OS X, and Linux (Any)
1 to 10 Angular schematics Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Errata

  • Page 246: In Configuring the state section, the command "nx generate ngrx app --root --no-interactive --project=tour --module=apps/tour/src/app/app.module.ts" must be read as "nx generate ngrx app --root --no-interactive --module=apps/tour/src/app/app.module.ts".

Related products

Get to Know the Author

Aristeidis Bampakos is an experienced frontend web developer and a Google Developer Expert for the Angular framework. From 2011, he has mainly focused on developing applications with AngularJS and Angular frameworks, Typescript, and Angular Material. He is currently working at Plex-Earth where he specializes in Angular development and also works as an Angular Senior Tech Instructor for Code.Hub where he teaches the Angular framework to other developers and individuals.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781800205260

angular-projects-second-edition's People

Contributors

bampakoa avatar deepesh-packt avatar keagancarneiro avatar packt-itservice avatar packt-pradeeps avatar packtutkarshr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-projects-second-edition's Issues

Project Chapter 3 : ng add @clr/angular fails Unable to find compatible package

‼ Unable to find compatible package. Using 'latest' tag.
‼ Package has unmet peer dependencies. Adding the package may not succeed.

The package @clr/[email protected] will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"~13.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^12.0.0" from @clr/[email protected]
npm ERR! node_modules/@clr/angular
npm ERR! @clr/angular@"12.0.7" from the root project

How does one resolve this? I tried downgrading the @angular/common libraries but was unsuccessful in getting this to install.

[bug: Chapter03 -> issues.service.ts -> updateIssue() ] - The current declaration it's assigning value instead comparing it

const existingIssue = this.issues.find(i => i.issueNo = issueNo);

Here should be have three (or two) equals operators. The current declaration it's assigning value instead comparing it:

- Current version:
const existingIssue = this.issues.find(i => i.issueNo = issueNo);

- Bugfix version:
const existingIssue = this.issues.find(i => i.issueNo === issueNo);

NOTE: Cheers, i'm enjoying your book!!

Angular 13/14 update?

Any chance we will see some updated steps for Angular 13 or 14 now that is is released?
A lot of the code in the book doesn't seem to work with the newer versions, mostly because certain plugins are running on old version numbers.

Observable<UpdateAvailableEvent> is deprecated:

https://github.com/PacktPublishing/Angular-Projects-Second-Edition/blob/main/Chapter04/src/app/app.component.ts uses deprecated "available", and gets the following message:

(property) SwUpdate.available: Observable
Emits an UpdateAvailableEvent event whenever a new app version is available.

@deprecated
Use versionUpdates instead.

The of behavior available can be rebuild by filtering for the VersionReadyEvent:

import {filter, map} from 'rxjs/operators';
// ...
const updatesAvailable = swUpdate.versionUpdates.pipe(
filter((evt): evt is VersionReadyEvent => evt.type === 'VERSION_READY'),
map(evt => ({
type: 'UPDATE_AVAILABLE',
current: evt.currentVersion,
available: evt.latestVersion,
})));

I'm trying to figure out how to add the snackbar and other actions but don't have it yet. Ideas?! Thx!

AngularFire API v. 7.0.0 (released 2021-08-25 for Angular 12) includes Breaking Changes for Chapter 6 Project

The path of least resistance is using the compatibility mode (@angular/fire/* changes to @angular/fire/compat/*). Alternatively, at an appropriate juncture, code compatible with the new API could be implemented. The angularfire doc linked below currently warns, "the new API isn't feature complete."

See https://github.com/angular/angularfire/blob/master/docs/version-7-upgrade.md and https://stackoverflow.com/a/68939303.

Chapter 5 (ngx-wig) setup error

Hello, I am working on Chapter 5 (WYSIWYG Editor) and after installing ngx-wig, I have been getting these kinds of errors:

Error: ../../../../../node_modules/ngx-wig/lib/ngx-wig.module.d.ts:15:25 - error TS2694: Namespace '"/Users/xxx/node_modules/@angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.

15     static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<NgxWigModule>;

I followed the book scripts exactly.

Here's my Angular Set-up:

Angular CLI: 12.1.4
Node: 14.17.4
Package Manager: npm 7.20.3
OS: darwin x64

Angular: 12.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1201.4
@angular-devkit/build-angular   12.1.4
@angular-devkit/core            12.1.4
@angular-devkit/schematics      12.1.4
@schematics/angular             12.1.4
rxjs                            6.6.7
typescript                      4.3.5

All other previous scripts and new test project installs work with ng-serve. But this one doesn't work. I only get Cannot GET / on the page.

Hope you can help. Really looking forward to this chapter. Thanks!

Chapter 10: crud-service in collection.json missing the schema

I have written the crud-service schematic in Angular 14 so this may probably be an issue related to the Angular version, I thought of mentioning it since it took me a while to find the solution and I am afraid others could also struggle with it

After creating the crud-service schematic I kept getting the following error:

   Error: Unknown argument: name

But everything I wrote was the same as the code in this repo, the only way I could find to fix it is by adding @schematics/angular to the schematics project dependencies and then update the collection.json file in the following way:

    "crud-service": {
      "description": "Generate a CRUD HTTP service",
      "factory": "./crud-service/index#crudService",
+      "schema": "../node_modules/@schematics/angular/service/schema.json"
    }

I assume that now Angular prevents unspecified options to be provided or something of that sort? 🤔

Please let me know what you think 🙂 (and if you believe I am missing something)

Project 2 assets image path

In the contact component the image is referenced as assets/angular.png . This works when using ng serve but will break when serving the project with scully.
The fix I found is to use a relative path (although it might not look as clean)

<img class="card-img-top" src="../../assets/angular.png" alt="Angular Logo">

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.