Skip to content

Commit

Permalink
refactor(transformers): use Angular downlevel-ctor transformer (#1099)
Browse files Browse the repository at this point in the history
Since we don't support Angular 9 anymore, it is safe to import `downlevel-ctor` transformer from `@angular/compiler-cli`
  • Loading branch information
ahnpnl authored Oct 18, 2021
1 parent a5fbe99 commit 3c26aba
Show file tree
Hide file tree
Showing 19 changed files with 756 additions and 1,428 deletions.
12 changes: 10 additions & 2 deletions examples/example-app-v10/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';

import { FooService } from './foo.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
export class AppComponent implements OnInit {
title = 'example-app-v10';

constructor(private fooService: FooService) {}

ngOnInit(): void {
this.fooService.getFoo();
}
}
10 changes: 10 additions & 0 deletions examples/example-app-v10/src/app/foo.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';

@Injectable({
providedIn: 'root',
})
export class FooService {
getFoo(): string {
return 'foo';
}
}
12 changes: 10 additions & 2 deletions examples/example-app-v11/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';

import { FooService } from './foo.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
export class AppComponent implements OnInit {
title = 'example-app-v11';

constructor(private fooService: FooService) {}

ngOnInit(): void {
this.fooService.getFoo();
}
}
10 changes: 10 additions & 0 deletions examples/example-app-v11/src/app/foo.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';

@Injectable({
providedIn: 'root',
})
export class FooService {
getFoo(): string {
return 'foo';
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';

import { FooService } from './foo.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
export class AppComponent implements OnInit {
title = 'app1';

constructor(private fooService: FooService) {}

ngOnInit(): void {
this.fooService.getFoo();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';

@Injectable({
providedIn: 'root',
})
export class FooService {
getFoo(): string {
return 'foo';
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';

import { FooService } from './foo.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
export class AppComponent implements OnInit {
title = 'app2';

constructor(private fooService: FooService) {}

ngOnInit(): void {
this.fooService.getFoo();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';

@Injectable({
providedIn: 'root',
})
export class FooService {
getFoo(): string {
return 'foo';
}
}
12 changes: 10 additions & 2 deletions examples/example-app-v12/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';

import { FooService } from './foo.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
export class AppComponent implements OnInit {
title = 'example-app-v12';

constructor(private fooService: FooService) {}

ngOnInit(): void {
this.fooService.getFoo();
}
}
10 changes: 10 additions & 0 deletions examples/example-app-v12/src/app/foo.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';

@Injectable({
providedIn: 'root',
})
export class FooService {
getFoo(): string {
return 'foo';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,26 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~12.2.2",
"@angular/common": "~12.2.2",
"@angular/compiler": "~12.2.2",
"@angular/core": "~12.2.2",
"@angular/forms": "~12.2.2",
"@angular/platform-browser": "~12.2.2",
"@angular/platform-browser-dynamic": "~12.2.2",
"@angular/router": "~12.2.2",
"angular-gridster2": "^12.1.0",
"@angular/animations": "~12.2.10",
"@angular/common": "~12.2.10",
"@angular/compiler": "~12.2.10",
"@angular/core": "~12.2.10",
"@angular/forms": "~12.2.10",
"@angular/platform-browser": "~12.2.10",
"@angular/platform-browser-dynamic": "~12.2.10",
"@angular/router": "~12.2.10",
"rxjs": "~6.6.0",
"tslib": "^2.3.1",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.2",
"@angular/cli": "~12.2.2",
"@angular/compiler-cli": "~12.2.2",
"@types/jest": "^27.0.1",
"@angular-devkit/build-angular": "~12.2.10",
"@angular/cli": "~12.2.10",
"@angular/compiler-cli": "~12.2.10",
"@types/jest": "^27.0.2",
"@types/node": "^12.11.1",
"jest": "^27.0.6",
"jest-preset-angular": "^10.0.0",
"jest": "^27.3.0",
"jest-preset-angular": "^10.0.1",
"typescript": "~4.3.2"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';

import { FooService } from './foo.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
export class AppComponent implements OnInit {
title = 'example-app-yarn-workspace';

constructor(private fooService: FooService) {}

ngOnInit(): void {
this.fooService.getFoo();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';

@Injectable({
providedIn: 'root',
})
export class FooService {
getFoo(): string {
return 'foo';
}
}
Loading

0 comments on commit 3c26aba

Please sign in to comment.