<commit_before>// #docregion import-http
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
// #docregion props
import { Product } from './products';
// #enddocregion props, import-http

@Injectable({
  providedIn: 'root'
})
// #docregion props, methods, inject-http, get-shipping
export class CartService {
// #enddocregion get-shipping
  items: Product[] = [];
// #enddocregion props, methods

  constructor(
    private http: HttpClient
  ) {}
// #enddocregion inject-http
// #docregion methods

  addToCart(product: Product) {
    this.items.push(product);
  }

  getItems() {
    return this.items;
  }

  clearCart() {
    this.items = [];
    return this.items;
  }
// #enddocregion methods

// #docregion get-shipping
  getShippingPrices() {
    return this.http.get<{type: string, price: number}[]>('/assets/shipping.json');
  }
// #docregion props, methods, inject-http
}
// #enddocregion props, methods, inject-http
<commit_msg>docs(docs-infra): add missing decorator in tutorial step (#47456) PR Close #47456<commit_after>// #docregion import-http
import { HttpClient } from '@angular/common/http';
// #docregion props
import { Product } from './products';
import { Injectable } from '@angular/core';
// #enddocregion props, import-http

// #docregion props, methods, inject-http, get-shipping
@Injectable({
  providedIn: 'root'
})
export class CartService {
// #enddocregion get-shipping
  items: Product[] = [];
// #enddocregion props, methods

  constructor(
    private http: HttpClient
  ) {}
// #enddocregion inject-http
// #docregion methods

  addToCart(product: Product) {
    this.items.push(product);
  }

  getItems() {
    return this.items;
  }

  clearCart() {
    this.items = [];
    return this.items;
  }
// #enddocregion methods

// #docregion get-shipping
  getShippingPrices() {
    return this.http.get<{type: string, price: number}[]>('/assets/shipping.json');
  }
// #docregion props, methods, inject-http
}
// #enddocregion props, methods, inject-http

{'fraction_non_alphanumeric': 0.15240904621435594, 'fraction_numerical': 0.004916420845624385, 'mean_word_length': 3.7106481481481484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5010190', 'n_tokens_mistral': 662, 'n_tokens_neox': 647, 'n_words': 158}