Skip to content

Commit 2fe7d90

Browse files
authored
Merge pull request #285 from design4pro/develop
fix(ng-styled): lint errors fix
2 parents 3988c5d + 9884f6d commit 2fe7d90

17 files changed

Lines changed: 28 additions & 27 deletions
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component } from '@angular/core';
22

33
@Component({
44
selector: 'ng-styled-app-shell',
55
templateUrl: './app-shell.component.html',
66
styleUrls: ['./app-shell.component.css'],
77
})
8-
export class AppShellComponent implements OnInit {
9-
constructor() {}
10-
11-
ngOnInit(): void {}
12-
}
8+
export class AppShellComponent {}

apps/ng-styled-webpage/src/app/app.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { TestBed } from '@angular/core/testing';
2+
import { RouterModule } from '@angular/router';
23
import { AppComponent } from './app.component';
34

45
describe('AppComponent', () => {
56
beforeEach(async () => {
67
await TestBed.configureTestingModule({
78
declarations: [AppComponent],
9+
imports: [RouterModule],
810
}).compileComponents();
911
});
1012

apps/ng-styled-webpage/src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
import {
44
createTheme,
5-
StyledModule,
65
Options,
6+
StyledModule,
77
Theme,
88
} from '@design4pro/ng-styled';
99
import { create, Jss } from 'jss';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<p>layout-footer works!</p>
1+
<p>©{{ year }} DESIGN4PRO</p>

apps/ng-styled-webpage/src/app/layout/layout-footer/layout-footer.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
55
templateUrl: './layout-footer.component.html',
66
changeDetection: ChangeDetectionStrategy.OnPush,
77
})
8-
export class LayoutFooterComponent {}
8+
export class LayoutFooterComponent {
9+
year = new Date().getFullYear();
10+
}

apps/ng-styled-webpage/src/app/layout/layout-header/layout-header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
width="48"
55
alt="Angular Logo"
66
/>
7-
<h1 [ngClass]="classes.h1">Angular JSS <span>by DESIGN4PRO</span></h1>
7+
<h1 [ngClass]="classes?.h1">Angular JSS <span>by DESIGN4PRO</span></h1>

apps/ng-styled-webpage/src/app/layout/layout-header/layout-header.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
32
import { LayoutHeaderComponent } from './layout-header.component';
43

54
describe('LayoutHeaderComponent', () => {

apps/ng-styled-webpage/src/app/layout/layout-header/layout-header.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { COMPONENT_STYLES } from './layout-header.component.styles';
99
})
1010
@Styled(({ css }) => css(COMPONENT_STYLES))
1111
export class LayoutHeaderComponent {
12-
classes: any;
12+
classes: { host: string; h1: string } | undefined;
1313

1414
@HostBinding('class')
1515
get className() {
16-
return this.classes.host;
16+
return this.classes?.host;
1717
}
1818
}

apps/ng-styled-webpage/src/app/layout/layout.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
2+
import { AppModule } from '../app.module';
33
import { LayoutComponent } from './layout.component';
44

55
describe('LayoutComponent', () => {
@@ -8,7 +8,7 @@ describe('LayoutComponent', () => {
88

99
beforeEach(async () => {
1010
await TestBed.configureTestingModule({
11-
declarations: [LayoutComponent],
11+
imports: [AppModule],
1212
}).compileComponents();
1313
});
1414

apps/ng-styled-webpage/src/app/layout/layout.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { COMPONENT_STYLES } from './layout.component.styles';
99
})
1010
@Styled(({ css }) => css(COMPONENT_STYLES))
1111
export class LayoutComponent {
12-
classes: any;
12+
classes: { host: string } | undefined;
1313

1414
@HostBinding('class')
1515
get className() {
16-
return this.classes.host;
16+
return this.classes?.host;
1717
}
1818
}

0 commit comments

Comments
 (0)