diff --git a/adev/src/content/tutorials/first-app/steps/10-routing/src/app/housing.service.ts b/adev/src/content/tutorials/first-app/steps/10-routing/src/app/housing.service.ts index 2c0a8c0247e7..dc26f65b756b 100644 --- a/adev/src/content/tutorials/first-app/steps/10-routing/src/app/housing.service.ts +++ b/adev/src/content/tutorials/first-app/steps/10-routing/src/app/housing.service.ts @@ -1,8 +1,6 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {HousingLocationInfo} from './housinglocation'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class HousingService { readonly baseUrl = 'https://angular.dev/assets/images/tutorials/common'; diff --git a/adev/src/content/tutorials/first-app/steps/11-details-page/src/app/housing.service.ts b/adev/src/content/tutorials/first-app/steps/11-details-page/src/app/housing.service.ts index 609b19afc385..9bbb58abafa3 100644 --- a/adev/src/content/tutorials/first-app/steps/11-details-page/src/app/housing.service.ts +++ b/adev/src/content/tutorials/first-app/steps/11-details-page/src/app/housing.service.ts @@ -1,9 +1,7 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {HousingLocationInfo} from './housinglocation'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class HousingService { readonly baseUrl = 'https://angular.dev/assets/images/tutorials/common'; diff --git a/adev/src/content/tutorials/first-app/steps/12-forms/src/app/housing.service.ts b/adev/src/content/tutorials/first-app/steps/12-forms/src/app/housing.service.ts index 609b19afc385..9bbb58abafa3 100644 --- a/adev/src/content/tutorials/first-app/steps/12-forms/src/app/housing.service.ts +++ b/adev/src/content/tutorials/first-app/steps/12-forms/src/app/housing.service.ts @@ -1,9 +1,7 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {HousingLocationInfo} from './housinglocation'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class HousingService { readonly baseUrl = 'https://angular.dev/assets/images/tutorials/common'; diff --git a/adev/src/content/tutorials/first-app/steps/13-search/src/app/housing.service.ts b/adev/src/content/tutorials/first-app/steps/13-search/src/app/housing.service.ts index 96abae0c068a..8960dbb7cbb8 100644 --- a/adev/src/content/tutorials/first-app/steps/13-search/src/app/housing.service.ts +++ b/adev/src/content/tutorials/first-app/steps/13-search/src/app/housing.service.ts @@ -1,9 +1,7 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {HousingLocationInfo} from './housinglocation'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class HousingService { readonly baseUrl = 'https://angular.dev/assets/images/tutorials/common'; diff --git a/adev/src/content/tutorials/first-app/steps/14-http/src-final/app/housing.service.ts b/adev/src/content/tutorials/first-app/steps/14-http/src-final/app/housing.service.ts index 23c44f72f19b..1e6670da3395 100644 --- a/adev/src/content/tutorials/first-app/steps/14-http/src-final/app/housing.service.ts +++ b/adev/src/content/tutorials/first-app/steps/14-http/src-final/app/housing.service.ts @@ -1,9 +1,7 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {HousingLocationInfo} from './housinglocation'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class HousingService { url = 'http://localhost:3000/locations'; diff --git a/adev/src/content/tutorials/first-app/steps/14-http/src/app/housing.service.ts b/adev/src/content/tutorials/first-app/steps/14-http/src/app/housing.service.ts index c339ecfdd161..635fa9eafd07 100644 --- a/adev/src/content/tutorials/first-app/steps/14-http/src/app/housing.service.ts +++ b/adev/src/content/tutorials/first-app/steps/14-http/src/app/housing.service.ts @@ -1,9 +1,7 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {HousingLocationInfo} from './housinglocation'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class HousingService { readonly baseUrl = 'https://angular.dev/assets/images/tutorials/common'; diff --git a/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/README.md b/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/README.md index 7dcb21eebaa8..cf07a3f0dab8 100644 --- a/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/README.md +++ b/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/README.md @@ -13,7 +13,7 @@ Add readonly and computed signals to make the cart state reactive in `cart-store ```ts // Add the computed import -import {Injectable, signal, computed} from '@angular/core'; +import {Service, signal, computed} from '@angular/core'; // Then add these signals to the class: diff --git a/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/answer/src/app/cart-store.ts b/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/answer/src/app/cart-store.ts index 2a4bd9fdb06d..279cb6908b70 100644 --- a/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/answer/src/app/cart-store.ts +++ b/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/answer/src/app/cart-store.ts @@ -1,9 +1,7 @@ -import {Injectable, signal, computed} from '@angular/core'; +import {Service, signal, computed} from '@angular/core'; import {CartItem} from './cart-types'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class CartStore { private items = signal([]); diff --git a/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/src/app/cart-store.ts b/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/src/app/cart-store.ts index 5325d2392d3a..bb2aa92fb890 100644 --- a/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/src/app/cart-store.ts +++ b/adev/src/content/tutorials/signals/steps/7-using-signals-with-services/src/app/cart-store.ts @@ -1,10 +1,8 @@ // TODO: Import computed from @angular/core -import {Injectable, signal} from '@angular/core'; +import {Service, signal} from '@angular/core'; import {CartItem} from './cart-types'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class CartStore { private items = signal([]);