Skip to content

Commit

Permalink
Upgrade Angular Renaissance to Angular 19(Remove standalone flag) (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinnerhe authored Nov 27, 2024
1 parent 14e8688 commit fc00b4a
Show file tree
Hide file tree
Showing 29 changed files with 5,621 additions and 4,613 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, signal } from "@angular/core";

@Component({
standalone: true,
selector: "app-name",
template: `<h1>Hello {{ name() }}</h1>`,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, signal } from "@angular/core";

@Component({
standalone: true,
selector: "app-name",
template: `<h1>Hello {{ name() }}</h1>`,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Component, computed, signal } from "@angular/core";

@Component({
standalone: true,
selector: "app-doublecount",
selector: "app-double-count",
template: `<div>{{ doubleCount() }}</div>`,
})
export class DoublecountComponent {
export class DoubleCountComponent {
count = signal(10);

doubleCount = computed(() => this.count() * 2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Component } from "@angular/core";

@Component({
standalone: true,
selector: "app-helloworld",
selector: "app-hello-world",
template: `<h1>Hello world</h1>`,
})
export class HelloworldComponent {}
export class HelloWorldComponent {}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Component } from "@angular/core";

@Component({
standalone: true,
selector: "app-cssstyle",
selector: "app-css-style",
template: `
<h1 class="title">I am red</h1>
<button style="font-size: 10rem">I am a button</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component } from "@angular/core";

@Component({
standalone: true,
selector: "app-colors",
template: `
<ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, signal } from "@angular/core";

@Component({
standalone: true,
selector: "app-counter",
template: `
<p>Counter: {{ count() }}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { afterNextRender, Component, ElementRef, viewChild } from "@angular/core";

@Component({
standalone: true,
selector: "app-inputfocused",
selector: "app-input-focused",
template: `<input type="text" #inputRef />`,
})
export class InputfocusedComponent {
export class InputFocusedComponent {
inputRef = viewChild.required<ElementRef<HTMLInputElement>>("inputRef");

constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { Component, computed, signal } from "@angular/core";
const TRAFFIC_LIGHTS = ["red", "orange", "green"];

@Component({
standalone: true,
selector: "app-trafficlight",
selector: "app-traffic-light",
template: `
<button (click)="nextLight()">Next light</button>
<p>Light is: {{ light() }}</p>
Expand All @@ -24,7 +23,7 @@ const TRAFFIC_LIGHTS = ["red", "orange", "green"];
</p>
`,
})
export class TrafficlightComponent {
export class TrafficLightComponent {
lightIndex = signal(0);

light = computed(() => TRAFFIC_LIGHTS[this.lightIndex()]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Component, OnInit, signal } from "@angular/core";

@Component({
standalone: true,
selector: "app-pagetitle",
selector: "app-page-title",
template: `<p>Page title: {{ pageTitle() }}</p>`,
})
export class PagetitleComponent implements OnInit {
export class PageTitleComponent implements OnInit {
pageTitle = signal("");

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnDestroy, signal } from "@angular/core";

@Component({
standalone: true,
selector: "app-time",
template: `<p>Current time: {{ time() }}</p>`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component } from "@angular/core";
import { UserprofileComponent } from "./userprofile.component";

@Component({
standalone: true,
selector: "app-root",
imports: [UserprofileComponent],
template: `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, input } from "@angular/core";

@Component({
standalone: true,
selector: "app-userprofile",
template: `
<p>My name is {{ name() }}!</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, output } from "@angular/core";

@Component({
standalone: true,
selector: "app-answer-button",
template: `
<button (click)="yes.emit()">YES</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { Component, signal } from "@angular/core";
import { AnswerButtonComponent } from "./answer-button.component";

@Component({
standalone: true,
selector: "app-root",
imports: [AnswerButtonComponent],
template: `
<p>Are you happy?</p>
<app-answer-button (yes)="onAnswerYes()" (no)="onAnswerNo()">
</app-answer-button>
<app-answer-button (yes)="onAnswerYes()" (no)="onAnswerNo()" />
<p style="font-size: 50px">{{ isHappy() ? "😀" : "😥" }}</p>
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component } from "@angular/core";
import { FunnyButtonComponent } from "./funny-button.component";

@Component({
standalone: true,
selector: "app-root",
imports: [FunnyButtonComponent],
template: `<app-funny-button>Click me!</app-funny-button>`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component } from "@angular/core";

@Component({
standalone: true,
selector: "app-funny-button",
styles: `
button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component } from "@angular/core";
import { FunnyButtonComponent } from "./funny-button.component";

@Component({
standalone: true,
selector: "app-root",
imports: [FunnyButtonComponent],
template: `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, ContentChild, TemplateRef } from "@angular/core";

@Component({
standalone: true,
selector: "app-funny-button",
styles: `
button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { UserService } from "./user.service";
import { UserProfileComponent } from "./user-profile.component";

@Component({
standalone: true,
imports: [UserProfileComponent],
providers: [UserService],
selector: "app-root",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, inject } from "@angular/core";
import { UserService } from "./user.service";

@Component({
standalone: true,
selector: "app-user-profile",
template: `
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, signal } from "@angular/core";
import { FormsModule } from "@angular/forms";

@Component({
standalone: true,
imports: [FormsModule],
selector: "app-input-hello",
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, signal } from "@angular/core";
import { FormsModule } from "@angular/forms";

@Component({
standalone: true,
imports: [FormsModule],
selector: "app-is-available",
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, signal } from "@angular/core";
import { FormsModule } from "@angular/forms";

@Component({
standalone: true,
imports: [FormsModule],
selector: "app-pick-pill",
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, signal } from "@angular/core";
import { FormsModule } from "@angular/forms";

@Component({
standalone: true,
imports: [FormsModule],
selector: "app-color-select",
template: `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component } from "@angular/core";

@Component({
standalone: true,
selector: "app-root",
template: `<h1>Hello World</h1>`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, inject } from "@angular/core";
import { UserService } from "./user.service";

@Component({
standalone: true,
selector: "app-users",
template: `
@let vm = userService.state();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@angular-eslint/eslint-plugin": "^18.3.1",
"@angular-eslint/eslint-plugin-template": "^18.3.1",
"@angular-eslint/template-parser": "^18.3.1",
"@angular/core": "^18.2.8",
"@angular/core": "^19.0.1",
"@aurelia/router": "2.0.0-beta.22",
"@babel/core": "^7.25.8",
"@babel/eslint-parser": "^7.25.8",
Expand Down
Loading

0 comments on commit fc00b4a

Please sign in to comment.