Skip to content

Commit 3783caf

Browse files
committed
refactor(transformers): use Angular downlevel-ctor transformer (#1099)
Since we don't support Angular 9 anymore, it is safe to import `downlevel-ctor` transformer from `@angular/compiler-cli`
1 parent 774c378 commit 3783caf

File tree

19 files changed

+755
-1427
lines changed

19 files changed

+755
-1427
lines changed
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
2+
3+
import { FooService } from './foo.service';
24

35
@Component({
46
selector: 'app-root',
57
templateUrl: './app.component.html',
68
styleUrls: ['./app.component.css'],
79
})
8-
export class AppComponent {
10+
export class AppComponent implements OnInit {
911
title = 'example-app-v10';
12+
13+
constructor(private fooService: FooService) {}
14+
15+
ngOnInit(): void {
16+
this.fooService.getFoo();
17+
}
1018
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({
4+
providedIn: 'root',
5+
})
6+
export class FooService {
7+
getFoo(): string {
8+
return 'foo';
9+
}
10+
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
2+
3+
import { FooService } from './foo.service';
24

35
@Component({
46
selector: 'app-root',
57
templateUrl: './app.component.html',
68
styleUrls: ['./app.component.css'],
79
})
8-
export class AppComponent {
10+
export class AppComponent implements OnInit {
911
title = 'example-app-v11';
12+
13+
constructor(private fooService: FooService) {}
14+
15+
ngOnInit(): void {
16+
this.fooService.getFoo();
17+
}
1018
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({
4+
providedIn: 'root',
5+
})
6+
export class FooService {
7+
getFoo(): string {
8+
return 'foo';
9+
}
10+
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
2+
3+
import { FooService } from './foo.service';
24

35
@Component({
46
selector: 'app-root',
57
templateUrl: './app.component.html',
68
styleUrls: ['./app.component.css'],
79
})
8-
export class AppComponent {
10+
export class AppComponent implements OnInit {
911
title = 'app1';
12+
13+
constructor(private fooService: FooService) {}
14+
15+
ngOnInit(): void {
16+
this.fooService.getFoo();
17+
}
1018
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({
4+
providedIn: 'root',
5+
})
6+
export class FooService {
7+
getFoo(): string {
8+
return 'foo';
9+
}
10+
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
2+
3+
import { FooService } from './foo.service';
24

35
@Component({
46
selector: 'app-root',
57
templateUrl: './app.component.html',
68
styleUrls: ['./app.component.css'],
79
})
8-
export class AppComponent {
10+
export class AppComponent implements OnInit {
911
title = 'app2';
12+
13+
constructor(private fooService: FooService) {}
14+
15+
ngOnInit(): void {
16+
this.fooService.getFoo();
17+
}
1018
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({
4+
providedIn: 'root',
5+
})
6+
export class FooService {
7+
getFoo(): string {
8+
return 'foo';
9+
}
10+
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
2+
3+
import { FooService } from './foo.service';
24

35
@Component({
46
selector: 'app-root',
57
templateUrl: './app.component.html',
68
styleUrls: ['./app.component.css'],
79
})
8-
export class AppComponent {
10+
export class AppComponent implements OnInit {
911
title = 'example-app-v12';
12+
13+
constructor(private fooService: FooService) {}
14+
15+
ngOnInit(): void {
16+
this.fooService.getFoo();
17+
}
1018
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({
4+
providedIn: 'root',
5+
})
6+
export class FooService {
7+
getFoo(): string {
8+
return 'foo';
9+
}
10+
}

0 commit comments

Comments
 (0)