SuperITMan links
Tag cloud
Picture wall
Daily
RSS Feed
  • RSS Feed
  • Daily Feed
  • Weekly Feed
  • Monthly Feed
Filters

Links per page

  • 20 links
  • 50 links
  • 100 links

Filters

Untagged links
1 result tagged stark  ✕
How Using Angular’s inject() Function Has Saved Me 1000 Lines of Code | by Francesco Borzì | JavaScript in Plain English https://javascript.plainenglish.io/how-using-the-angulars-inject-function-has-saved-me-1000-lines-of-code-82b699183da8
Tue Jun 25 23:53:16 2024
QRCode
cluster icon
  • restic · Backups done right! :
  • détecteur présence avec contact libre potentiel pour activer knx (entrée binaire) + RF (commutateur) :
  • How to Customize Your Angular Build With Webpack | Okta Developer : Interesting post about the customization of the Angular Build system
  • Obsidian Starter Course :
  • Automation - awesome-selfhosted :

The old way of injecting dependencies using the constructor:

import { Component } from '@angular/core';

@Component({ / ... / })
export class MyComponent {
constructor(
@Inject(SOME_TOKEN) private readonly someToken: string,
private readonly myService: MyService,
private readonly httpClient: HttpClient,
) {}
}

The new way of injecting dependencies using the inject() function:

import { Component, inject } from '@angular/core';

@Component({ / ... / })
export class MyComponent {
private readonly someToken = inject(SOME_TOKEN);
private readonly myService = inject(MyService);
private readonly httpClient = inject(HttpClient);
}

2024 angular todo stark
836 links, including 77 private
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Theme by kalvn