✨ In 2023 Angular introduced:
‣ New Signals-based reactivity model
‣ Deferrable views
‣ >80% faster build pipeline
‣ More ergonomic control flow
‣ Modern brand colors and docs
‣ Full app hydration
‣ more features and improvements
...in a backwards compatible way 🙌
👋 Hey folks!
A new #Angular article is almost ready!
How to migrate CoreModule (or any other) module to standalone APIs
✅ use cases handled by modules
✅ standalone alternatives
✅ lots of examples
📡 Subscribe and get notified when it's out! angularexperts.io/blog
Version 2.2.0 of Angular Grid Layout is available!👀🚀
Here are the main features of this release:
- Highly customizable Background Grid🎨
- Added the capability to manually trigger the drag start event.💨
#Angular#opensource
Today we are excited to open the first PR of our exploration into fine-grained reactivity! 🚦
This is the foundation to allow prototyping & amplify the value of an upcoming RFC on our plans to introduce a new reactive primitive into Angular.
Read more: goo.gle/ng-watch-this-space
🧙♂️ By extending the `HttpClient`, you can add a simple `HttpContextToken` to every request and have server-specific interceptors in Angular.
Here is an example that prepends the request path with the server URL. It may not be the best use case, but explains the idea. 🤷♂️
ALT import { HttpClient, HttpContext, HttpRequest } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { IS_JSON_PLACEHOLDER } from './http-contexts';
@Injectable({
providedIn: 'root',
})
export class JsonPlaceholderClient extends HttpClient {
override request(
first: string | HttpRequest<any>,
url?: string,
options: RequestOptions = {}
): Observable<any> {
if (typeof first === 'string') {
this.#setPlaceholderContext(options);
return super.request(first, url, options);
}
this.#setPlaceholderContext(first);
return super.request(first);
}
#setPlaceholderContext(optionsOrRequest: { context?: HttpContext }) {
optionsOrRequest.context ??= new HttpContext();
optionsOrRequest.context.set(IS_JSON_PLACEHOLDER, true);
}
}
type RequestOptions = Parameters<HttpClient['request']>[2];
Functional router guards
Together with the tree-shakable standalone router APIs we worked on reducing boilerplate in guards!
With the new functional router guards, you can refactor code down to:
ALT Code snippet showcasing the implementation of Functional Router Guards in Angular v15.
Angular 15 directive composition API example: An NgForOf variation that can use an observable, a promise, or an async generator as input.
stackblitz.com/edit/ng-for-a…
ALT Code from https://stackblitz.com/edit/ng-for-await?file=src/for-await-of.directive.ts
ALT Code from https://stackblitz.com/edit/ng-for-await?file=src/app.ts
Are you an @angular developer interested in sharing your knowledge with a community of already-established & budding developers? This is your chance. From standalone components to new router APIs.
Submit a talk today: bit.ly/ngketalk#100DaysOfCode#AngularKenya#Angular
Use subscribe.
tap is for when you want to wire up some repeatable side effect for multiple subscriptions.
Keep in mind that every operator you use adds the overhead another subscription.
Introducing: StackBlitz Codeflow! ♾
Codeflow is a one-click GitHub integration that keeps you in flow state by seamlessly weaving together:
- creating & reviewing pull requests
- fixing issues
- contributing to open-source repositories
in a way that wasn't possible before: 🧵