angular/packages/compiler-cli/test/compliance/test_cases
Kristiyan Kostadinov 8f3d0b9d97 feat(core): introduce @Service decorator
These changes introduce the new `@Service` decorator which is a more ergonomic alternative to `@Injectable`. The reason we're adding a new decorator is that `@Injectable` has been around since the beginning of Angular and it has a lot of baggage that adds unnecessary overhead for users that generally want to define a singleton service, available in their entire app. The key differences between `@Service` and `@Injectable` are:
1. `@Service` is `providedIn: 'root'` by default. You can opt into providing the service yourself by setting `autoProvided: false` on it.
2. `@Service` doesn't allow constructor-based injection, only the `inject` function.
3. `@Service` doesn't support the complex type signature of `@Injectable` (`useClass`, `useValue` etc.). Instead it supports a single `factory` function.

Example:

```ts
import {Service} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {AuthService} from './auth';

@Service()
export class PostService {
  private readonly httpClient = inject(HttpClient);
  private readonly authService = inject(AuthService);

  getUserPosts() {
    return this.httpClient.get('/api/posts/' + this.authService.userId);
  }
}
```
2026-04-22 11:01:01 -07:00
..
model_inputs refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
output_function fix(compiler): throw on duplicate input/outputs 2026-02-26 13:47:37 -08:00
r3_compiler_compliance fix(compiler): don't escape dollar sign in literal expression 2026-04-10 09:23:50 +03:00
r3_view_compiler refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
r3_view_compiler_arrow_functions refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
r3_view_compiler_bindings refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
r3_view_compiler_control_flow refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
r3_view_compiler_deferred refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
r3_view_compiler_di/di refactor(compiler): add ts-ignore comment on factory functions 2026-03-18 14:05:18 -06:00
r3_view_compiler_directives feat(core): add support for TypeScript 6 2026-02-17 08:40:38 -08:00
r3_view_compiler_i18n refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
r3_view_compiler_input_outputs test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_let refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
r3_view_compiler_listener refactor(compiler): remove fullTemplateTypeCheck compiler option. 2026-04-06 11:55:09 -07:00
r3_view_compiler_providers test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_styling fix(compiler): handle nested brackets in host object bindings 2026-04-06 13:21:50 -07:00
r3_view_compiler_template test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
service_decorator feat(core): introduce @Service decorator 2026-04-22 11:01:01 -07:00
signal_inputs refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
signal_queries refactor(compiler): update tests after codegen changes 2026-03-16 09:58:18 -06:00
source_mapping test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
BUILD.bazel refactor(compiler): rename isolated tests to codegen 2026-03-16 09:58:18 -06:00
list_golden_update_rules.ts test(core): remove shelljs from core schematics tests (#64042) 2025-09-26 13:14:09 -04:00
test_case_schema.json refactor(compiler-cli): check if generated code compiles in compliance tests 2026-03-16 09:58:18 -06:00