Skip to content

Commit

Permalink
style(demo): reformat demo code thanks to prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperITMan committed Dec 13, 2023
1 parent e1d941b commit 157eb76
Show file tree
Hide file tree
Showing 13 changed files with 387 additions and 421 deletions.
33 changes: 7 additions & 26 deletions demo-app/ng12/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,10 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/normalize.css/normalize.css",
"src/styles/styles.scss"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["node_modules/normalize.css/normalize.css", "src/styles/styles.scss"],
"stylePreprocessorOptions": {
"includePaths": [
"src/styles"
]
"includePaths": ["src/styles"]
},
"scripts": [],
"vendorChunk": true,
Expand Down Expand Up @@ -100,29 +92,18 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [
"node_modules/normalize.css/normalize.css",
"src/styles/styles.scss"
],
"styles": ["node_modules/normalize.css/normalize.css", "src/styles/styles.scss"],
"stylePreprocessorOptions": {
"includePaths": [
"src/styles"
]
"includePaths": ["src/styles"]
},
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
"assets": ["src/favicon.ico", "src/assets"]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
},
"e2e": {
Expand Down
58 changes: 27 additions & 31 deletions demo-app/ng12/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
import { ComponentFixture, TestBed, waitForAsync} from "@angular/core/testing";
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { AppComponent } from "./app.component";
import { RouterTestingModule } from "@angular/router/testing";
import { NO_ERRORS_SCHEMA } from "@angular/core";

describe("AppComponent", () => {
let fixture: ComponentFixture<AppComponent>;
let component: AppComponent;
let fixture: ComponentFixture<AppComponent>;
let component: AppComponent;

beforeEach(waitForAsync(() => {
return TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
schemas: [ NO_ERRORS_SCHEMA ]
}).compileComponents();
}));
beforeEach(waitForAsync(() => {
return TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it("should create the app", () => {
expect(fixture).toBeDefined();
expect(component).toBeDefined();
});
it("should create the app", () => {
expect(fixture).toBeDefined();
expect(component).toBeDefined();
});

it("should render title in a h1 tag", () => {
fixture.detectChanges();
const compiled: HTMLElement = fixture.debugElement.nativeElement;
const h1Element = compiled.querySelector("h1");
expect(h1Element).toBeTruthy();
// tslint:disable-next-line:no-non-null-assertion
expect(h1Element!.textContent).toContain("Ngx-Form-Errors");
});
it("should render title in a h1 tag", () => {
fixture.detectChanges();
const compiled: HTMLElement = fixture.debugElement.nativeElement;
const h1Element = compiled.querySelector("h1");
expect(h1Element).toBeTruthy();
// tslint:disable-next-line:no-non-null-assertion
expect(h1Element!.textContent).toContain("Ngx-Form-Errors");
});
});
44 changes: 22 additions & 22 deletions demo-app/ng12/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ import { NgxFormsExampleComponent, ReactiveFormsExampleComponent, TemplateDriven
NavigationComponent,
CardComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
FormsModule,
HttpClientModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatFormFieldModule,
MatGridListModule,
MatInputModule,
MatToolbarModule,
MatListModule,
MatSidenavModule,
MatIconModule,
ReactiveFormsModule,
TranslateModule.forRoot(),
NgxFormErrorsModule.forRoot({
formErrorComponent: TranslatedFormErrorComponent
})
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
FormsModule,
HttpClientModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatFormFieldModule,
MatGridListModule,
MatInputModule,
MatToolbarModule,
MatListModule,
MatSidenavModule,
MatIconModule,
ReactiveFormsModule,
TranslateModule.forRoot(),
NgxFormErrorsModule.forRoot({
formErrorComponent: TranslatedFormErrorComponent
})
],
exports: [LanguageSelectorComponent],
providers: [],
entryComponents: [SimpleFormErrorComponent, TranslatedFormErrorComponent],
Expand Down
1 change: 0 additions & 1 deletion demo-app/ng12/src/app/components/card/card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ export class CardComponent {
break;
}
}

}
2 changes: 1 addition & 1 deletion demo-app/ng12/src/app/components/card/card.theme.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '~@angular/material' as mat;
@use "~@angular/material" as mat;
@mixin card-theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '~@angular/material' as mat;
@use "~@angular/material" as mat;
@mixin language-selector-theme($theme) {
$primary: map-get($theme, primary);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ const componentName = "navigation";
export class NavigationComponent {
@HostBinding("class")
public cssClass: string = componentName;

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '~@angular/material' as mat;
@use "~@angular/material" as mat;
@mixin app-navigation-theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
Expand Down
Loading

0 comments on commit 157eb76

Please sign in to comment.