Skip to content

Commit db74fb3

Browse files
cexbrayatalan-agius4
authored andcommitted
fix(@schematics/angular): use protected for class member
This follows the updated style guide recommendations. https://next.angular.dev/style-guide#use-protected-on-class-members-that-are-only-used-by-a-components-template
1 parent 32c4d0f commit db74fb3

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ describe('App', () => {
2222
expect(app).toBeTruthy();
2323
});
2424

25-
it(`should have as title '<%= name %>'`, () => {
26-
const fixture = TestBed.createComponent(App);
27-
const app = fixture.componentInstance;
28-
expect(app.title).toEqual('<%= name %>');
29-
});
30-
3125
it('should render title', () => {
3226
const fixture = TestBed.createComponent(App);
3327
fixture.detectChanges();

packages/schematics/angular/application/files/module-files/src/app/app.ts.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ import { Component } from '@angular/core';
1515
styleUrl: './app.<%= style %>'<% } %>
1616
})
1717
export class App {
18-
title = '<%= name %>';
18+
protected title = '<%= name %>';
1919
}

packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ describe('App', () => {
1616
expect(app).toBeTruthy();
1717
});
1818

19-
it(`should have the '<%= name %>' title`, () => {
20-
const fixture = TestBed.createComponent(App);
21-
const app = fixture.componentInstance;
22-
expect(app.title).toEqual('<%= name %>');
23-
});
24-
2519
it('should render title', () => {
2620
const fixture = TestBed.createComponent(App);
2721
fixture.detectChanges();

packages/schematics/angular/application/files/standalone-files/src/app/app.ts.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ import { RouterOutlet } from '@angular/router';<% } %>
1616
styleUrl: './app.<%= style %>'<% } %>
1717
})
1818
export class App {
19-
title = '<%= name %>';
19+
protected title = '<%= name %>';
2020
}

0 commit comments

Comments
 (0)