Skip to content

Commit 157eb76

Browse files
committed
style(demo): reformat demo code thanks to prettier
1 parent e1d941b commit 157eb76

File tree

13 files changed

+387
-421
lines changed

13 files changed

+387
-421
lines changed

demo-app/ng12/angular.json

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@
2222
"main": "src/main.ts",
2323
"polyfills": "src/polyfills.ts",
2424
"tsConfig": "tsconfig.app.json",
25-
"assets": [
26-
"src/favicon.ico",
27-
"src/assets"
28-
],
29-
"styles": [
30-
"node_modules/normalize.css/normalize.css",
31-
"src/styles/styles.scss"
32-
],
25+
"assets": ["src/favicon.ico", "src/assets"],
26+
"styles": ["node_modules/normalize.css/normalize.css", "src/styles/styles.scss"],
3327
"stylePreprocessorOptions": {
34-
"includePaths": [
35-
"src/styles"
36-
]
28+
"includePaths": ["src/styles"]
3729
},
3830
"scripts": [],
3931
"vendorChunk": true,
@@ -100,29 +92,18 @@
10092
"polyfills": "src/polyfills.ts",
10193
"tsConfig": "tsconfig.spec.json",
10294
"karmaConfig": "karma.conf.js",
103-
"styles": [
104-
"node_modules/normalize.css/normalize.css",
105-
"src/styles/styles.scss"
106-
],
95+
"styles": ["node_modules/normalize.css/normalize.css", "src/styles/styles.scss"],
10796
"stylePreprocessorOptions": {
108-
"includePaths": [
109-
"src/styles"
110-
]
97+
"includePaths": ["src/styles"]
11198
},
11299
"scripts": [],
113-
"assets": [
114-
"src/favicon.ico",
115-
"src/assets"
116-
]
100+
"assets": ["src/favicon.ico", "src/assets"]
117101
}
118102
},
119103
"lint": {
120104
"builder": "@angular-eslint/builder:lint",
121105
"options": {
122-
"lintFilePatterns": [
123-
"src/**/*.ts",
124-
"src/**/*.html"
125-
]
106+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
126107
}
127108
},
128109
"e2e": {
Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
1-
import { ComponentFixture, TestBed, waitForAsync} from "@angular/core/testing";
1+
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
22
import { AppComponent } from "./app.component";
33
import { RouterTestingModule } from "@angular/router/testing";
44
import { NO_ERRORS_SCHEMA } from "@angular/core";
55

66
describe("AppComponent", () => {
7-
let fixture: ComponentFixture<AppComponent>;
8-
let component: AppComponent;
7+
let fixture: ComponentFixture<AppComponent>;
8+
let component: AppComponent;
99

10-
beforeEach(waitForAsync(() => {
11-
return TestBed.configureTestingModule({
12-
imports: [
13-
RouterTestingModule
14-
],
15-
declarations: [
16-
AppComponent
17-
],
18-
schemas: [ NO_ERRORS_SCHEMA ]
19-
}).compileComponents();
20-
}));
10+
beforeEach(waitForAsync(() => {
11+
return TestBed.configureTestingModule({
12+
imports: [RouterTestingModule],
13+
declarations: [AppComponent],
14+
schemas: [NO_ERRORS_SCHEMA]
15+
}).compileComponents();
16+
}));
2117

22-
beforeEach(() => {
23-
fixture = TestBed.createComponent(AppComponent);
24-
component = fixture.componentInstance;
25-
fixture.detectChanges();
26-
});
18+
beforeEach(() => {
19+
fixture = TestBed.createComponent(AppComponent);
20+
component = fixture.componentInstance;
21+
fixture.detectChanges();
22+
});
2723

28-
it("should create the app", () => {
29-
expect(fixture).toBeDefined();
30-
expect(component).toBeDefined();
31-
});
24+
it("should create the app", () => {
25+
expect(fixture).toBeDefined();
26+
expect(component).toBeDefined();
27+
});
3228

33-
it("should render title in a h1 tag", () => {
34-
fixture.detectChanges();
35-
const compiled: HTMLElement = fixture.debugElement.nativeElement;
36-
const h1Element = compiled.querySelector("h1");
37-
expect(h1Element).toBeTruthy();
38-
// tslint:disable-next-line:no-non-null-assertion
39-
expect(h1Element!.textContent).toContain("Ngx-Form-Errors");
40-
});
29+
it("should render title in a h1 tag", () => {
30+
fixture.detectChanges();
31+
const compiled: HTMLElement = fixture.debugElement.nativeElement;
32+
const h1Element = compiled.querySelector("h1");
33+
expect(h1Element).toBeTruthy();
34+
// tslint:disable-next-line:no-non-null-assertion
35+
expect(h1Element!.textContent).toContain("Ngx-Form-Errors");
36+
});
4137
});

demo-app/ng12/src/app/app.module.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,28 @@ import { NgxFormsExampleComponent, ReactiveFormsExampleComponent, TemplateDriven
3939
NavigationComponent,
4040
CardComponent
4141
],
42-
imports: [
43-
BrowserModule,
44-
BrowserAnimationsModule,
45-
AppRoutingModule,
46-
FormsModule,
47-
HttpClientModule,
48-
MatButtonModule,
49-
MatButtonToggleModule,
50-
MatCardModule,
51-
MatFormFieldModule,
52-
MatGridListModule,
53-
MatInputModule,
54-
MatToolbarModule,
55-
MatListModule,
56-
MatSidenavModule,
57-
MatIconModule,
58-
ReactiveFormsModule,
59-
TranslateModule.forRoot(),
60-
NgxFormErrorsModule.forRoot({
61-
formErrorComponent: TranslatedFormErrorComponent
62-
})
63-
],
42+
imports: [
43+
BrowserModule,
44+
BrowserAnimationsModule,
45+
AppRoutingModule,
46+
FormsModule,
47+
HttpClientModule,
48+
MatButtonModule,
49+
MatButtonToggleModule,
50+
MatCardModule,
51+
MatFormFieldModule,
52+
MatGridListModule,
53+
MatInputModule,
54+
MatToolbarModule,
55+
MatListModule,
56+
MatSidenavModule,
57+
MatIconModule,
58+
ReactiveFormsModule,
59+
TranslateModule.forRoot(),
60+
NgxFormErrorsModule.forRoot({
61+
formErrorComponent: TranslatedFormErrorComponent
62+
})
63+
],
6464
exports: [LanguageSelectorComponent],
6565
providers: [],
6666
entryComponents: [SimpleFormErrorComponent, TranslatedFormErrorComponent],

demo-app/ng12/src/app/components/card/card.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ export class CardComponent {
3939
break;
4040
}
4141
}
42-
4342
}

demo-app/ng12/src/app/components/card/card.theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '~@angular/material' as mat;
1+
@use "~@angular/material" as mat;
22
@mixin card-theme($theme) {
33
$primary: map-get($theme, primary);
44
$accent: map-get($theme, accent);

demo-app/ng12/src/app/components/language-selector/language-selector.theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '~@angular/material' as mat;
1+
@use "~@angular/material" as mat;
22
@mixin language-selector-theme($theme) {
33
$primary: map-get($theme, primary);
44

demo-app/ng12/src/app/components/navigation/navigation.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ const componentName = "navigation";
1010
export class NavigationComponent {
1111
@HostBinding("class")
1212
public cssClass: string = componentName;
13-
1413
}

demo-app/ng12/src/app/components/navigation/navigation.theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '~@angular/material' as mat;
1+
@use "~@angular/material" as mat;
22
@mixin app-navigation-theme($theme) {
33
$primary: map-get($theme, primary);
44
$accent: map-get($theme, accent);

0 commit comments

Comments
 (0)