Skip to content
This repository was archived by the owner on Sep 21, 2018. It is now read-only.

Commit a5756cb

Browse files
committed
chore(Code Style): restyled code
1 parent ee0f331 commit a5756cb

Some content is hidden

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

44 files changed

+326
-336
lines changed

src/app/actions/book.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Action } from '@ngrx/store';
22
import { Book } from '../models/book';
33

4-
export const SEARCH = '[Book] Search';
5-
export const SEARCH_COMPLETE = '[Book] Search Complete';
6-
export const LOAD = '[Book] Load';
7-
export const SELECT = '[Book] Select';
8-
4+
export const SEARCH = '[Book] Search';
5+
export const SEARCH_COMPLETE = '[Book] Search Complete';
6+
export const LOAD = '[Book] Load';
7+
export const SELECT = '[Book] Select';
98

109
/**
1110
* Every action is comprised of at least a type and an optional
@@ -17,25 +16,29 @@ export const SELECT = '[Book] Select';
1716
export class SearchAction implements Action {
1817
readonly type = SEARCH;
1918

20-
constructor(public payload: string) { }
19+
constructor(public payload: string) {
20+
}
2121
}
2222

2323
export class SearchCompleteAction implements Action {
2424
readonly type = SEARCH_COMPLETE;
2525

26-
constructor(public payload: Book[]) { }
26+
constructor(public payload: Book[]) {
27+
}
2728
}
2829

2930
export class LoadAction implements Action {
3031
readonly type = LOAD;
3132

32-
constructor(public payload: Book) { }
33+
constructor(public payload: Book) {
34+
}
3335
}
3436

3537
export class SelectAction implements Action {
3638
readonly type = SELECT;
3739

38-
constructor(public payload: string) { }
40+
constructor(public payload: string) {
41+
}
3942
}
4043

4144
/**

src/app/actions/collection.ts

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,62 @@
11
import { Action } from '@ngrx/store';
22
import { Book } from '../models/book';
33

4-
5-
export const ADD_BOOK = '[Collection] Add Book';
6-
export const ADD_BOOK_SUCCESS = '[Collection] Add Book Success';
7-
export const ADD_BOOK_FAIL = '[Collection] Add Book Fail';
8-
export const REMOVE_BOOK = '[Collection] Remove Book';
9-
export const REMOVE_BOOK_SUCCESS = '[Collection] Remove Book Success';
10-
export const REMOVE_BOOK_FAIL = '[Collection] Remove Book Fail';
11-
export const LOAD = '[Collection] Load';
12-
export const LOAD_SUCCESS = '[Collection] Load Success';
13-
export const LOAD_FAIL = '[Collection] Load Fail';
14-
4+
export const ADD_BOOK = '[Collection] Add Book';
5+
export const ADD_BOOK_SUCCESS = '[Collection] Add Book Success';
6+
export const ADD_BOOK_FAIL = '[Collection] Add Book Fail';
7+
export const REMOVE_BOOK = '[Collection] Remove Book';
8+
export const REMOVE_BOOK_SUCCESS = '[Collection] Remove Book Success';
9+
export const REMOVE_BOOK_FAIL = '[Collection] Remove Book Fail';
10+
export const LOAD = '[Collection] Load';
11+
export const LOAD_SUCCESS = '[Collection] Load Success';
12+
export const LOAD_FAIL = '[Collection] Load Fail';
1513

1614
/**
1715
* Add Book to Collection Actions
1816
*/
1917
export class AddBookAction implements Action {
2018
readonly type = ADD_BOOK;
2119

22-
constructor(public payload: Book) { }
20+
constructor(public payload: Book) {
21+
}
2322
}
2423

2524
export class AddBookSuccessAction implements Action {
2625
readonly type = ADD_BOOK_SUCCESS;
2726

28-
constructor(public payload: Book) { }
27+
constructor(public payload: Book) {
28+
}
2929
}
3030

3131
export class AddBookFailAction implements Action {
3232
readonly type = ADD_BOOK_FAIL;
3333

34-
constructor(public payload: Book) { }
34+
constructor(public payload: Book) {
35+
}
3536
}
3637

37-
3838
/**
3939
* Remove Book from Collection Actions
4040
*/
4141
export class RemoveBookAction implements Action {
4242
readonly type = REMOVE_BOOK;
4343

44-
constructor(public payload: Book) { }
44+
constructor(public payload: Book) {
45+
}
4546
}
4647

4748
export class RemoveBookSuccessAction implements Action {
4849
readonly type = REMOVE_BOOK_SUCCESS;
4950

50-
constructor(public payload: Book) { }
51+
constructor(public payload: Book) {
52+
}
5153
}
5254

5355
export class RemoveBookFailAction implements Action {
5456
readonly type = REMOVE_BOOK_FAIL;
5557

56-
constructor(public payload: Book) {}
58+
constructor(public payload: Book) {
59+
}
5760
}
5861

5962
/**
@@ -66,16 +69,17 @@ export class LoadAction implements Action {
6669
export class LoadSuccessAction implements Action {
6770
readonly type = LOAD_SUCCESS;
6871

69-
constructor(public payload: Book[]) { }
72+
constructor(public payload: Book[]) {
73+
}
7074
}
7175

7276
export class LoadFailAction implements Action {
7377
readonly type = LOAD_FAIL;
7478

75-
constructor(public payload: any) { }
79+
constructor(public payload: any) {
80+
}
7681
}
7782

78-
7983
export type Actions
8084
= AddBookAction
8185
| AddBookSuccessAction

src/app/actions/layout.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Action } from '@ngrx/store';
22

3-
export const OPEN_SIDENAV = '[Layout] Open Sidenav';
4-
export const CLOSE_SIDENAV = '[Layout] Close Sidenav';
5-
3+
export const OPEN_SIDENAV = '[Layout] Open Sidenav';
4+
export const CLOSE_SIDENAV = '[Layout] Close Sidenav';
65

76
export class OpenSidenavAction implements Action {
87
readonly type = OPEN_SIDENAV;
@@ -12,7 +11,6 @@ export class CloseSidenavAction implements Action {
1211
readonly type = CLOSE_SIDENAV;
1312
}
1413

15-
1614
export type Actions
1715
= OpenSidenavAction
1816
| CloseSidenavAction;

src/app/app.module.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ import { routes } from './routes';
2929
import { reducer } from './reducers';
3030
import { schema } from './db';
3131

32-
33-
3432
@NgModule({
3533
imports: [
3634
CommonModule,
@@ -88,14 +86,15 @@ import { schema } from './db';
8886
SelectedBookPageComponent,
8987
ViewBookPageComponent,
9088
CollectionPageComponent,
91-
NotFoundPageComponent
89+
NotFoundPageComponent,
9290
],
9391
providers: [
9492
BookExistsGuard,
95-
GoogleBooksService
93+
GoogleBooksService,
9694
],
9795
bootstrap: [
98-
AppComponent
99-
]
96+
AppComponent,
97+
],
10098
})
101-
export class AppModule { }
99+
export class AppModule {
100+
}

src/app/components/book-authors.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@ import { Component, Input } from '@angular/core';
22

33
import { Book } from '../models/book';
44

5-
65
@Component({
76
selector: 'bc-book-authors',
87
template: `
9-
<h5 md-subheader>Written By:</h5>
10-
<span>
8+
<h5 md-subheader>Written By:</h5>
9+
<span>
1110
{{ authors | bcAddCommas }}
1211
</span>
1312
`,
14-
styles: [`
15-
h5 {
16-
margin-bottom: 5px;
17-
}
18-
`]
13+
styles: [
14+
`
15+
h5 {
16+
margin-bottom: 5px;
17+
}
18+
`,
19+
],
1920
})
2021
export class BookAuthorsComponent {
2122
@Input() book: Book;

src/app/components/book-detail.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Component, Input, Output, EventEmitter } from '@angular/core';
1+
import { Component, EventEmitter, Input, Output } from '@angular/core';
22
import { Book } from '../models/book';
33

4-
54
@Component({
65
selector: 'bc-book-detail',
76
template: `
@@ -29,7 +28,8 @@ import { Book } from '../models/book';
2928
</md-card>
3029
3130
`,
32-
styles: [`
31+
styles: [
32+
`
3333
:host {
3434
display: flex;
3535
justify-content: center;
@@ -56,7 +56,8 @@ import { Book } from '../models/book';
5656
padding: 0 25px 25px;
5757
position: relative;
5858
}
59-
`]
59+
`,
60+
],
6061
})
6162
export class BookDetailComponent {
6263
/**
@@ -65,14 +66,14 @@ export class BookDetailComponent {
6566
* own. All decisions are delegated to 'container', or 'smart'
6667
* components before data updates flow back down.
6768
*
68-
* More on 'smart' and 'presentational' components: https://gist.github.com/btroncone/a6e4347326749f938510#utilizing-container-components
69+
* More on 'smart' and 'presentational' components:
70+
* https://gist.github.com/btroncone/a6e4347326749f938510#utilizing-container-components
6971
*/
7072
@Input() book: Book;
7173
@Input() inCollection: boolean;
7274
@Output() add = new EventEmitter<Book>();
7375
@Output() remove = new EventEmitter<Book>();
7476

75-
7677
/**
7778
* Tip: Utilize getters to keep templates clean
7879
*/

src/app/components/book-preview-list.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import { Book } from '../models/book';
66
template: `
77
<bc-book-preview *ngFor="let book of books" [book]="book"></bc-book-preview>
88
`,
9-
styles: [`
9+
styles: [
10+
`
1011
:host {
1112
display: flex;
1213
flex-wrap: wrap;
1314
justify-content: center;
1415
}
15-
`]
16+
`,
17+
],
1618
})
1719
export class BookPreviewListComponent {
1820
@Input() books: Book[];

src/app/components/book-preview.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Component, Input } from '@angular/core';
22
import { Book } from '../models/book';
33

4-
54
@Component({
65
selector: 'bc-book-preview',
76
template: `
@@ -21,7 +20,8 @@ import { Book } from '../models/book';
2120
</md-card>
2221
</a>
2322
`,
24-
styles: [`
23+
styles: [
24+
`
2525
md-card {
2626
width: 400px;
2727
height: 300px;
@@ -61,7 +61,8 @@ import { Book } from '../models/book';
6161
md-card-footer {
6262
padding: 0 25px 25px;
6363
}
64-
`]
64+
`,
65+
],
6566
})
6667
export class BookPreviewComponent {
6768
@Input() book: Book;

0 commit comments

Comments
 (0)