Skip to content

Commit 1d92f89

Browse files
chore: add lint-staged to format files on commit
Closes #26
1 parent 608b630 commit 1d92f89

File tree

72 files changed

+2189
-2005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2189
-2005
lines changed

apps/example-app/src/app/auth/auth.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ export const COMPONENTS = [
2929
],
3030
declarations: COMPONENTS,
3131
entryComponents: [LogoutConfirmationDialogComponent],
32-
exports: COMPONENTS
32+
exports: COMPONENTS,
3333
})
3434
export class AuthModule {}

apps/example-app/src/app/books/components/book-preview.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Book } from '@example-app/books/models';
55
@Component({
66
selector: 'bc-book-preview',
77
template: `
8-
<a linkTo="/books/{{id}}">
8+
<a linkTo="/books/{{ id }}">
99
<mat-card>
1010
<mat-card-title-group>
1111
<img mat-card-sm-image *ngIf="thumbnail" [src]="thumbnail" />

apps/example-app/src/app/books/containers/view-book-page.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ import { ViewBookPageActions } from '@example-app/books/actions';
2525
export class ViewBookPageComponent implements OnDestroy {
2626
actionsSubscription: Subscription;
2727

28-
constructor(store: Store<fromBooks.State>, routeParams$: RouteParams<{ id: string }>) {
28+
constructor(
29+
store: Store<fromBooks.State>,
30+
routeParams$: RouteParams<{ id: string }>
31+
) {
2932
this.actionsSubscription = routeParams$
3033
.pipe(map((params) => ViewBookPageActions.selectBook({ id: params.id })))
3134
.subscribe((action) => store.dispatch(action));
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
3-
/*
4-
Copyright Google LLC. All Rights Reserved.
5-
Use of this source code is governed by an MIT-style license that
6-
can be found in the LICENSE file at http://angular.io/license
7-
*/
1+
/*
2+
Copyright Google LLC. All Rights Reserved.
3+
Use of this source code is governed by an MIT-style license that
4+
can be found in the LICENSE file at http://angular.io/license
5+
*/
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<app-top-bar></app-top-bar>
2-
3-
<div class="container">
4-
<router>
5-
<route path="/products/:productId">
6-
<app-product-details *routeComponent></app-product-details>
7-
</route>
8-
<route path="/cart">
9-
<app-cart *routeComponent></app-cart>
10-
</route>
11-
<route path="/shipping">
12-
<app-shipping *routeComponent></app-shipping>
13-
</route>
14-
<route path="/">
15-
<app-product-list *routeComponent></app-product-list>
16-
</route>
17-
</router>
18-
</div>
19-
20-
<!--
21-
Copyright Google LLC. All Rights Reserved.
22-
Use of this source code is governed by an MIT-style license that
23-
can be found in the LICENSE file at http://angular.io/license
24-
-->
1+
<app-top-bar></app-top-bar>
2+
3+
<div class="container">
4+
<router>
5+
<route path="/products/:productId">
6+
<app-product-details *routeComponent></app-product-details>
7+
</route>
8+
<route path="/cart">
9+
<app-cart *routeComponent></app-cart>
10+
</route>
11+
<route path="/shipping">
12+
<app-shipping *routeComponent></app-shipping>
13+
</route>
14+
<route path="/">
15+
<app-product-list *routeComponent></app-product-list>
16+
</route>
17+
</router>
18+
</div>
19+
20+
<!--
21+
Copyright Google LLC. All Rights Reserved.
22+
Use of this source code is governed by an MIT-style license that
23+
can be found in the LICENSE file at http://angular.io/license
24+
-->
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { Component } from '@angular/core';
2-
3-
@Component({
4-
selector: 'app-root',
5-
templateUrl: './app.component.html',
6-
styleUrls: ['./app.component.css']
7-
})
8-
export class AppComponent {
9-
}
10-
11-
12-
/*
13-
Copyright Google LLC. All Rights Reserved.
14-
Use of this source code is governed by an MIT-style license that
15-
can be found in the LICENSE file at http://angular.io/license
16-
*/
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.css'],
7+
})
8+
export class AppComponent {}
9+
10+
/*
11+
Copyright Google LLC. All Rights Reserved.
12+
Use of this source code is governed by an MIT-style license that
13+
can be found in the LICENSE file at http://angular.io/license
14+
*/
Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
1-
import { NgModule } from '@angular/core';
2-
import { BrowserModule } from '@angular/platform-browser';
3-
import { RoutingModule } from 'angular-routing';
4-
import { HttpClientModule } from '@angular/common/http';
5-
import { ReactiveFormsModule } from '@angular/forms';
6-
7-
import { AppComponent } from './app.component';
8-
import { TopBarComponent } from './top-bar/top-bar.component';
9-
import { ProductListComponent } from './product-list/product-list.component';
10-
import { ProductAlertsComponent } from './product-alerts/product-alerts.component';
11-
import { ProductDetailsComponent } from './product-details/product-details.component';
12-
import { CartComponent } from './cart/cart.component';
13-
import { ShippingComponent } from './shipping/shipping.component';
14-
15-
16-
@NgModule({
17-
imports: [
18-
BrowserModule,
19-
HttpClientModule,
20-
ReactiveFormsModule,
21-
RoutingModule.forRoot()
22-
],
23-
declarations: [
24-
AppComponent,
25-
TopBarComponent,
26-
ProductListComponent,
27-
ProductAlertsComponent,
28-
ProductDetailsComponent,
29-
CartComponent,
30-
ShippingComponent
31-
],
32-
bootstrap: [
33-
AppComponent
34-
]
35-
})
36-
export class AppModule { }
37-
38-
39-
/*
40-
Copyright Google LLC. All Rights Reserved.
41-
Use of this source code is governed by an MIT-style license that
42-
can be found in the LICENSE file at http://angular.io/license
43-
*/
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { RoutingModule } from 'angular-routing';
4+
import { HttpClientModule } from '@angular/common/http';
5+
import { ReactiveFormsModule } from '@angular/forms';
6+
7+
import { AppComponent } from './app.component';
8+
import { TopBarComponent } from './top-bar/top-bar.component';
9+
import { ProductListComponent } from './product-list/product-list.component';
10+
import { ProductAlertsComponent } from './product-alerts/product-alerts.component';
11+
import { ProductDetailsComponent } from './product-details/product-details.component';
12+
import { CartComponent } from './cart/cart.component';
13+
import { ShippingComponent } from './shipping/shipping.component';
14+
15+
@NgModule({
16+
imports: [
17+
BrowserModule,
18+
HttpClientModule,
19+
ReactiveFormsModule,
20+
RoutingModule.forRoot(),
21+
],
22+
declarations: [
23+
AppComponent,
24+
TopBarComponent,
25+
ProductListComponent,
26+
ProductAlertsComponent,
27+
ProductDetailsComponent,
28+
CartComponent,
29+
ShippingComponent,
30+
],
31+
bootstrap: [AppComponent],
32+
})
33+
export class AppModule {}
34+
35+
/*
36+
Copyright Google LLC. All Rights Reserved.
37+
Use of this source code is governed by an MIT-style license that
38+
can be found in the LICENSE file at http://angular.io/license
39+
*/
Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
1-
import { Injectable } from '@angular/core';
2-
3-
import { HttpClient } from '@angular/common/http';
4-
@Injectable({
5-
providedIn: 'root'
6-
})
7-
export class CartService {
8-
items = [];
9-
10-
constructor(
11-
private http: HttpClient
12-
) {}
13-
14-
addToCart(product) {
15-
this.items.push(product);
16-
}
17-
18-
getItems() {
19-
return this.items;
20-
}
21-
22-
clearCart() {
23-
this.items = [];
24-
return this.items;
25-
}
26-
27-
getShippingPrices() {
28-
return this.http.get('/assets/shipping.json');
29-
}
30-
}
31-
32-
33-
/*
34-
Copyright Google LLC. All Rights Reserved.
35-
Use of this source code is governed by an MIT-style license that
36-
can be found in the LICENSE file at http://angular.io/license
37-
*/
1+
import { Injectable } from '@angular/core';
2+
3+
import { HttpClient } from '@angular/common/http';
4+
@Injectable({
5+
providedIn: 'root',
6+
})
7+
export class CartService {
8+
items = [];
9+
10+
constructor(private http: HttpClient) {}
11+
12+
addToCart(product) {
13+
this.items.push(product);
14+
}
15+
16+
getItems() {
17+
return this.items;
18+
}
19+
20+
clearCart() {
21+
this.items = [];
22+
return this.items;
23+
}
24+
25+
getShippingPrices() {
26+
return this.http.get('/assets/shipping.json');
27+
}
28+
}
29+
30+
/*
31+
Copyright Google LLC. All Rights Reserved.
32+
Use of this source code is governed by an MIT-style license that
33+
can be found in the LICENSE file at http://angular.io/license
34+
*/
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
3-
/*
4-
Copyright Google LLC. All Rights Reserved.
5-
Use of this source code is governed by an MIT-style license that
6-
can be found in the LICENSE file at http://angular.io/license
7-
*/
1+
/*
2+
Copyright Google LLC. All Rights Reserved.
3+
Use of this source code is governed by an MIT-style license that
4+
can be found in the LICENSE file at http://angular.io/license
5+
*/
Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
1-
<h3>Cart</h3>
2-
3-
<p>
4-
<a linkTo="/shipping">Shipping Prices</a>
5-
</p>
6-
7-
<div class="cart-item" *ngFor="let item of items">
8-
<span>{{ item.name }} </span>
9-
<span>{{ item.price | currency }}</span>
10-
</div>
11-
12-
<form [formGroup]="checkoutForm" (ngSubmit)="onSubmit(checkoutForm.value)">
13-
14-
<div>
15-
<label for="name">
16-
Name
17-
</label>
18-
<input id="name" type="text" formControlName="name">
19-
</div>
20-
21-
<div>
22-
<label for="address">
23-
Address
24-
</label>
25-
<input id="address" type="text" formControlName="address">
26-
</div>
27-
28-
<button class="button" type="submit">Purchase</button>
29-
30-
</form>
31-
32-
33-
<!--
34-
Copyright Google LLC. All Rights Reserved.
35-
Use of this source code is governed by an MIT-style license that
36-
can be found in the LICENSE file at http://angular.io/license
37-
-->
1+
<h3>Cart</h3>
2+
3+
<p>
4+
<a linkTo="/shipping">Shipping Prices</a>
5+
</p>
6+
7+
<div class="cart-item" *ngFor="let item of items">
8+
<span>{{ item.name }} </span>
9+
<span>{{ item.price | currency }}</span>
10+
</div>
11+
12+
<form [formGroup]="checkoutForm" (ngSubmit)="onSubmit(checkoutForm.value)">
13+
<div>
14+
<label for="name">
15+
Name
16+
</label>
17+
<input id="name" type="text" formControlName="name" />
18+
</div>
19+
20+
<div>
21+
<label for="address">
22+
Address
23+
</label>
24+
<input id="address" type="text" formControlName="address" />
25+
</div>
26+
27+
<button class="button" type="submit">Purchase</button>
28+
</form>
29+
30+
<!--
31+
Copyright Google LLC. All Rights Reserved.
32+
Use of this source code is governed by an MIT-style license that
33+
can be found in the LICENSE file at http://angular.io/license
34+
-->

0 commit comments

Comments
 (0)