From c846b7448260df44d25525ccaedc0de4fbc4f7a7 Mon Sep 17 00:00:00 2001 From: Randall Meeker Date: Sat, 25 Sep 2021 16:32:10 -0500 Subject: [PATCH] prettier-all-the-things --- package-lock.json | 6 ++ package.json | 1 + src/app/app.component.ts | 2 +- src/app/app.module.ts | 77 +++++++++++-------- src/app/auth/+state/auth.model.ts | 2 +- src/app/auth/+state/auth.query.ts | 2 - src/app/auth/+state/auth.service.ts | 3 +- src/app/auth/+state/auth.store.ts | 1 - src/app/auth/auth.module.ts | 6 +- src/app/auth/signin/signin.component.html | 34 +++++--- src/app/auth/signin/signin.component.ts | 35 +++++---- .../collection-group/+state/company.query.ts | 2 - .../+state/company.service.ts | 1 - .../collection-group/+state/company.store.ts | 14 ++-- .../company-list/company-list.component.ts | 8 +- src/app/collection-group/company.module.ts | 8 +- src/app/collection/+state/movie.model.ts | 2 +- src/app/collection/+state/movie.query.ts | 2 - src/app/collection/+state/movie.service.ts | 21 +++-- src/app/collection/+state/movie.store.ts | 12 ++- .../movie-create/movie-create.component.ts | 5 +- .../movie-form/movie-form.component.html | 16 +++- .../movie-form/movie-form.component.ts | 12 ++- .../movie-home/movie-home.component.html | 4 +- .../movie-home/movie-home.component.ts | 4 +- .../movie-item/movie-item.component.html | 4 +- .../movie-item/movie-item.component.ts | 10 ++- .../movie-list/movie-list.component.html | 7 +- .../movie-list/movie-list.component.ts | 4 +- .../movie-view/movie-view.component.html | 29 ++++--- .../movie-view/movie-view.component.ts | 5 +- src/app/collection/movie.form.ts | 2 +- src/app/collection/movie.guard.ts | 13 ++-- src/app/collection/movie.module.ts | 19 +++-- .../dynamic-store/+state/marketplace.query.ts | 2 - .../+state/marketplace.service.ts | 2 - .../dynamic-store/+state/marketplace.store.ts | 6 +- .../marketplace-carousel.component.html | 2 +- .../marketplace-carousel.component.ts | 11 ++- .../marketplace-home.component.html | 2 +- .../marketplace-home.component.ts | 3 +- src/app/dynamic-store/marketplace.module.ts | 11 ++- src/app/home/home.component.html | 6 +- src/app/home/home.component.ts | 2 +- src/app/many-active/+state/catalog.query.ts | 2 - src/app/many-active/+state/catalog.service.ts | 2 - src/app/many-active/+state/catalog.store.ts | 14 ++-- .../catalog-list/catalog-list.component.html | 2 +- .../catalog-list/catalog-list.component.ts | 11 +-- .../catalog-selection.component.html | 2 +- .../catalog-selection.component.ts | 9 +-- src/app/many-active/catalog.module.ts | 4 +- src/app/material.module.ts | 2 +- src/app/real-time/+state/vehicle.query.ts | 2 - src/app/real-time/+state/vehicle.service.ts | 3 +- src/app/real-time/+state/vehicle.store.ts | 14 ++-- src/app/real-time/vehicle.component.html | 22 ++++-- src/app/real-time/vehicle.component.ts | 49 ++++++------ src/app/real-time/vehicle.module.ts | 12 +-- .../subcollection/+state/stakeholder.model.ts | 2 +- .../subcollection/+state/stakeholder.query.ts | 2 - .../+state/stakeholder.service.ts | 6 +- .../subcollection/+state/stakeholder.store.ts | 14 ++-- .../stakeholder-create.component.ts | 6 +- .../stakeholder-edit.component.ts | 13 ++-- .../stakeholder-form.component.html | 8 +- .../stakeholder-form.component.ts | 11 ++- .../stakeholder-list.component.ts | 7 +- src/app/subcollection/stakeholder.guard.ts | 25 ++++-- src/app/subcollection/stakeholder.module.ts | 21 ++--- .../+state/organization.model.ts | 6 +- .../+state/organization.query.ts | 2 - .../+state/organization.service.ts | 9 +-- .../+state/organization.store.ts | 11 ++- .../organization-create.component.html | 4 +- .../organization-create.component.ts | 12 +-- .../organization-list.component.ts | 5 +- .../organization-view.component.css | 3 +- .../organization-view.component.html | 14 +++- .../organization-view.component.ts | 18 +++-- src/app/sync-many-ids/organization.guard.ts | 2 - src/app/sync-many-ids/organization.module.ts | 15 +++- src/environments/environment.prod.ts | 16 ++-- src/environments/environment.ts | 18 ++--- src/index.html | 32 ++++---- src/main.ts | 6 +- src/polyfills.ts | 3 +- src/styles.scss | 10 ++- src/test.ts | 2 +- 89 files changed, 508 insertions(+), 365 deletions(-) diff --git a/package-lock.json b/package-lock.json index caa96318..8bcd3693 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16058,6 +16058,12 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, + "prettier": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "dev": true + }, "pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/package.json b/package.json index 53199d20..281df330 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "karma-jasmine-html-reporter": "^1.5.0", "karma-mocha-reporter": "^2.2.5", "ng-packagr": "^12.0.0", + "prettier": "^2.4.1", "ts-node": "~7.0.0", "tslint": "~6.1.0", "typescript": "^4.2.3" diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 73547c71..28abdb99 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,6 +2,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-root', - template: '' + template: '', }) export class AppComponent {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9b41a114..53bf232e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -32,36 +32,51 @@ import { environment } from 'src/environments/environment'; AngularFireAuthModule, AngularFireDatabaseModule, // Routers - RouterModule.forRoot([ - { path: '', redirectTo: 'home', pathMatch: 'full' }, - { path: 'home', component: HomeComponent }, - { - path: 'movies', - loadChildren: () => import('./collection/movie.module').then(m => m.MovieModule) - }, - { - path: 'catalog', - loadChildren: () => import('./many-active/catalog.module').then(m => m.CatalogModule) - }, - { - path: 'company', - loadChildren: () => import('./collection-group/company.module').then(m => m.CompanyModule) - }, - { - path: 'organization', - loadChildren: () => import('./sync-many-ids/organization.module').then(m => m.OrganizationModule) - }, - { - path: 'marketplace', - loadChildren: () => import('./dynamic-store/marketplace.module').then(m => m.MarketplaceModule) - }, - { - path: 'vehicle', - loadChildren: () => import('./real-time/vehicle.module').then(m => m.VehicleModule) - } - ], { paramsInheritanceStrategy: 'always', relativeLinkResolution: 'legacy' }), - AkitaNgRouterStoreModule + RouterModule.forRoot( + [ + { path: '', redirectTo: 'home', pathMatch: 'full' }, + { path: 'home', component: HomeComponent }, + { + path: 'movies', + loadChildren: () => + import('./collection/movie.module').then((m) => m.MovieModule), + }, + { + path: 'catalog', + loadChildren: () => + import('./many-active/catalog.module').then((m) => m.CatalogModule), + }, + { + path: 'company', + loadChildren: () => + import('./collection-group/company.module').then( + (m) => m.CompanyModule + ), + }, + { + path: 'organization', + loadChildren: () => + import('./sync-many-ids/organization.module').then( + (m) => m.OrganizationModule + ), + }, + { + path: 'marketplace', + loadChildren: () => + import('./dynamic-store/marketplace.module').then( + (m) => m.MarketplaceModule + ), + }, + { + path: 'vehicle', + loadChildren: () => + import('./real-time/vehicle.module').then((m) => m.VehicleModule), + }, + ], + { paramsInheritanceStrategy: 'always', relativeLinkResolution: 'legacy' } + ), + AkitaNgRouterStoreModule, ], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/auth/+state/auth.model.ts b/src/app/auth/+state/auth.model.ts index e312b3cc..ef923c00 100644 --- a/src/app/auth/+state/auth.model.ts +++ b/src/app/auth/+state/auth.model.ts @@ -11,6 +11,6 @@ export function createProfile(profile: Partial): Profile { photoURL: '', organizationIds: [], email: '', - ...profile + ...profile, }; } diff --git a/src/app/auth/+state/auth.query.ts b/src/app/auth/+state/auth.query.ts index 311d0b0d..0af6c099 100644 --- a/src/app/auth/+state/auth.query.ts +++ b/src/app/auth/+state/auth.query.ts @@ -4,9 +4,7 @@ import { AuthStore, AuthState } from './auth.store'; @Injectable({ providedIn: 'root' }) export class AuthQuery extends Query { - constructor(protected store: AuthStore) { super(store); } - } diff --git a/src/app/auth/+state/auth.service.ts b/src/app/auth/+state/auth.service.ts index 16cc6df7..3d6f1b82 100644 --- a/src/app/auth/+state/auth.service.ts +++ b/src/app/auth/+state/auth.service.ts @@ -5,14 +5,13 @@ import { AuthStore, AuthState } from './auth.store'; @Injectable({ providedIn: 'root' }) @CollectionConfig({ path: 'users' }) export class AuthService extends FireAuthService { - constructor(store: AuthStore) { super(store); } createProfile(user, ctx) { return { - email: user.email + email: user.email, } as any; } diff --git a/src/app/auth/+state/auth.store.ts b/src/app/auth/+state/auth.store.ts index 18e1de46..6d69384b 100644 --- a/src/app/auth/+state/auth.store.ts +++ b/src/app/auth/+state/auth.store.ts @@ -20,4 +20,3 @@ export class AuthStore extends Store { super(initialState); } } - diff --git a/src/app/auth/auth.module.ts b/src/app/auth/auth.module.ts index bf68b8ee..1b74cc51 100644 --- a/src/app/auth/auth.module.ts +++ b/src/app/auth/auth.module.ts @@ -17,7 +17,7 @@ import { MatInputModule } from '@angular/material/input'; MatButtonModule, MatFormFieldModule, MatInputModule, - RouterModule - ] + RouterModule, + ], }) -export class AuthModule { } +export class AuthModule {} diff --git a/src/app/auth/signin/signin.component.html b/src/app/auth/signin/signin.component.html index dec2f6c9..fa9e7c6c 100644 --- a/src/app/auth/signin/signin.component.html +++ b/src/app/auth/signin/signin.component.html @@ -7,33 +7,45 @@

Welcome {{ email }}

- +

Signup with email and password

Email - + -
+
Password - + -
+

Signin with email and password

Email - + -
+
Password - + -
- +
+
-
\ No newline at end of file + diff --git a/src/app/auth/signin/signin.component.ts b/src/app/auth/signin/signin.component.ts index 7b279ef5..dbcca689 100644 --- a/src/app/auth/signin/signin.component.ts +++ b/src/app/auth/signin/signin.component.ts @@ -7,29 +7,27 @@ import { map } from 'rxjs/operators'; @Component({ selector: 'auth-signin', templateUrl: './signin.component.html', - styleUrls: ['./signin.component.scss'] + styleUrls: ['./signin.component.scss'], }) export class SigninComponent implements OnInit, OnDestroy { - private sub: Subscription; public profile$: Observable; signupForm = new FormGroup({ email: new FormControl(), - password: new FormControl() + password: new FormControl(), }); signinForm = new FormGroup({ email: new FormControl(), - password: new FormControl() + password: new FormControl(), }); - isLoggedIn = this.query.select('profile').pipe(map(value => !!value?.email)); + isLoggedIn = this.query + .select('profile') + .pipe(map((value) => !!value?.email)); - constructor( - private service: AuthService, - private query: AuthQuery - ) { } + constructor(private service: AuthService, private query: AuthQuery) {} ngOnInit() { this.sub = this.service.sync().subscribe(); @@ -45,13 +43,24 @@ export class SigninComponent implements OnInit, OnDestroy { } signupWithEmail() { - this.service.signin(this.signinForm.get('email').value, this.signinForm.get('password').value); + this.service.signin( + this.signinForm.get('email').value, + this.signinForm.get('password').value + ); } signup() { - this.service.signup(this.signupForm.get('email').value, this.signupForm.get('password').value).then(() => { - this.service.signin(this.signupForm.get('email').value, this.signupForm.get('password').value); - }); + this.service + .signup( + this.signupForm.get('email').value, + this.signupForm.get('password').value + ) + .then(() => { + this.service.signin( + this.signupForm.get('email').value, + this.signupForm.get('password').value + ); + }); } signout() { diff --git a/src/app/collection-group/+state/company.query.ts b/src/app/collection-group/+state/company.query.ts index 3535337e..8d7f13ce 100644 --- a/src/app/collection-group/+state/company.query.ts +++ b/src/app/collection-group/+state/company.query.ts @@ -4,9 +4,7 @@ import { CompanyStore, CompanyState } from './company.store'; @Injectable({ providedIn: 'root' }) export class CompanyQuery extends QueryEntity { - constructor(protected store: CompanyStore) { super(store); } - } diff --git a/src/app/collection-group/+state/company.service.ts b/src/app/collection-group/+state/company.service.ts index 17d8b81d..e7f78e1d 100644 --- a/src/app/collection-group/+state/company.service.ts +++ b/src/app/collection-group/+state/company.service.ts @@ -9,5 +9,4 @@ export class CompanyService extends CollectionGroupService { constructor(store: CompanyStore) { super(store); } - } diff --git a/src/app/collection-group/+state/company.store.ts b/src/app/collection-group/+state/company.store.ts index 241ae388..b7807341 100644 --- a/src/app/collection-group/+state/company.store.ts +++ b/src/app/collection-group/+state/company.store.ts @@ -1,16 +1,20 @@ import { Injectable } from '@angular/core'; -import { EntityState, ActiveState, EntityStore, StoreConfig } from '@datorama/akita'; +import { + EntityState, + ActiveState, + EntityStore, + StoreConfig, +} from '@datorama/akita'; import { Stakeholder } from 'src/app/subcollection/+state'; -export interface CompanyState extends EntityState, ActiveState {} +export interface CompanyState + extends EntityState, + ActiveState {} @Injectable({ providedIn: 'root' }) @StoreConfig({ name: 'company' }) export class CompanyStore extends EntityStore { - constructor() { super(); } - } - diff --git a/src/app/collection-group/company-list/company-list.component.ts b/src/app/collection-group/company-list/company-list.component.ts index 0ad76e37..272da082 100644 --- a/src/app/collection-group/company-list/company-list.component.ts +++ b/src/app/collection-group/company-list/company-list.component.ts @@ -6,17 +6,13 @@ import { Stakeholder } from 'src/app/subcollection/+state'; @Component({ selector: 'company-list', templateUrl: './company-list.component.html', - styleUrls: ['./company-list.component.css'] + styleUrls: ['./company-list.component.css'], }) export class CompanyListComponent implements OnInit, OnDestroy { - private sub: Subscription; companies$: Observable; - constructor( - private service: CompanyService, - private query: CompanyQuery - ) { } + constructor(private service: CompanyService, private query: CompanyQuery) {} ngOnInit() { this.sub = this.service.syncCollection().subscribe(); diff --git a/src/app/collection-group/company.module.ts b/src/app/collection-group/company.module.ts index 3c3a41aa..257b0718 100644 --- a/src/app/collection-group/company.module.ts +++ b/src/app/collection-group/company.module.ts @@ -11,8 +11,8 @@ import { MatListModule } from '@angular/material/list'; MatListModule, RouterModule.forChild([ { path: '', redirectTo: 'list', pathMatch: 'full' }, - { path: 'list', component: CompanyListComponent } - ]) - ] + { path: 'list', component: CompanyListComponent }, + ]), + ], }) -export class CompanyModule { } +export class CompanyModule {} diff --git a/src/app/collection/+state/movie.model.ts b/src/app/collection/+state/movie.model.ts index 5cd24446..f09738af 100644 --- a/src/app/collection/+state/movie.model.ts +++ b/src/app/collection/+state/movie.model.ts @@ -15,6 +15,6 @@ export function createMovie(params: Partial) { id: '', title: '', description: '', - ...params + ...params, } as Movie; } diff --git a/src/app/collection/+state/movie.query.ts b/src/app/collection/+state/movie.query.ts index 1772622a..49ae719c 100644 --- a/src/app/collection/+state/movie.query.ts +++ b/src/app/collection/+state/movie.query.ts @@ -4,9 +4,7 @@ import { MovieStore, MovieState } from './movie.store'; @Injectable({ providedIn: 'root' }) export class MovieQuery extends QueryEntity { - constructor(protected store: MovieStore) { super(store); } - } diff --git a/src/app/collection/+state/movie.service.ts b/src/app/collection/+state/movie.service.ts index e1584f0f..ec873cf7 100644 --- a/src/app/collection/+state/movie.service.ts +++ b/src/app/collection/+state/movie.service.ts @@ -1,14 +1,20 @@ import { Injectable } from '@angular/core'; import { MovieStore, MovieState } from './movie.store'; -import { CollectionConfig, CollectionService, WriteOptions, Query, syncQuery } from 'akita-ng-fire'; +import { + CollectionConfig, + CollectionService, + WriteOptions, + Query, + syncQuery, +} from 'akita-ng-fire'; import { Movie } from './movie.model'; import { StakeholderService } from 'src/app/subcollection/+state'; const movieQuery: Query = { path: 'movies', stakeholders: (movie: Movie) => ({ - path: `movies/${movie.id}/stakeholders` - }) + path: `movies/${movie.id}/stakeholders`, + }), }; @Injectable({ providedIn: 'root' }) @@ -16,7 +22,10 @@ const movieQuery: Query = { export class MovieService extends CollectionService { syncQuery = syncQuery.bind(this, movieQuery); - constructor(store: MovieStore, private stakeholderService: StakeholderService) { + constructor( + store: MovieStore, + private stakeholderService: StakeholderService + ) { super(store); } @@ -34,8 +43,8 @@ export class MovieService extends CollectionService { formatFromFirestore(movie: Readonly) { const alteredMovie = { ...movie, - description: `This description was altered by the formatFromFirestore function. Previously it was: "${movie?.description}"` - } + description: `This description was altered by the formatFromFirestore function. Previously it was: "${movie?.description}"`, + }; return alteredMovie; } } diff --git a/src/app/collection/+state/movie.store.ts b/src/app/collection/+state/movie.store.ts index 02f33988..2ecc5962 100644 --- a/src/app/collection/+state/movie.store.ts +++ b/src/app/collection/+state/movie.store.ts @@ -1,13 +1,19 @@ import { Injectable } from '@angular/core'; -import { EntityStore, StoreConfig, EntityState, ActiveState } from '@datorama/akita'; +import { + EntityStore, + StoreConfig, + EntityState, + ActiveState, +} from '@datorama/akita'; import { Movie } from './movie.model'; -export interface MovieState extends EntityState, ActiveState {} +export interface MovieState + extends EntityState, + ActiveState {} @Injectable({ providedIn: 'root' }) @StoreConfig({ name: 'movie' }) export class MovieStore extends EntityStore { - constructor() { super(); } diff --git a/src/app/collection/movie-create/movie-create.component.ts b/src/app/collection/movie-create/movie-create.component.ts index e8237270..d018a890 100644 --- a/src/app/collection/movie-create/movie-create.component.ts +++ b/src/app/collection/movie-create/movie-create.component.ts @@ -5,11 +5,10 @@ import { Router } from '@angular/router'; @Component({ selector: 'movie-create', templateUrl: './movie-create.component.html', - styleUrls: ['./movie-create.component.css'] + styleUrls: ['./movie-create.component.css'], }) export class MovieCreateComponent { - - constructor(private service: MovieService, private router: Router) { } + constructor(private service: MovieService, private router: Router) {} async create(movie: Movie) { await this.service.add(movie); diff --git a/src/app/collection/movie-form/movie-form.component.html b/src/app/collection/movie-form/movie-form.component.html index f676f863..60b9ba23 100644 --- a/src/app/collection/movie-form/movie-form.component.html +++ b/src/app/collection/movie-form/movie-form.component.html @@ -1,9 +1,21 @@
- + - +
diff --git a/src/app/collection/movie-form/movie-form.component.ts b/src/app/collection/movie-form/movie-form.component.ts index 2cec213c..73c4c4ec 100644 --- a/src/app/collection/movie-form/movie-form.component.ts +++ b/src/app/collection/movie-form/movie-form.component.ts @@ -1,4 +1,10 @@ -import { Component, OnInit, ChangeDetectionStrategy, Output, EventEmitter } from '@angular/core'; +import { + Component, + OnInit, + ChangeDetectionStrategy, + Output, + EventEmitter, +} from '@angular/core'; import { MovieForm } from '../movie.form'; import { MovieService, Movie } from '../+state'; @@ -6,10 +12,9 @@ import { MovieService, Movie } from '../+state'; selector: 'movie-form', templateUrl: './movie-form.component.html', styleUrls: ['./movie-form.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class MovieFormComponent implements OnInit { - @Output() create = new EventEmitter(); public form: MovieForm; @@ -18,5 +23,4 @@ export class MovieFormComponent implements OnInit { ngOnInit() { this.form = new MovieForm(); } - } diff --git a/src/app/collection/movie-home/movie-home.component.html b/src/app/collection/movie-home/movie-home.component.html index 693ce4c9..6023fdb0 100644 --- a/src/app/collection/movie-home/movie-home.component.html +++ b/src/app/collection/movie-home/movie-home.component.html @@ -1,3 +1,3 @@ -
- {{ movie.description }} +
+ {{ movie.description }}
diff --git a/src/app/collection/movie-home/movie-home.component.ts b/src/app/collection/movie-home/movie-home.component.ts index b252bbd2..60ee3c5d 100644 --- a/src/app/collection/movie-home/movie-home.component.ts +++ b/src/app/collection/movie-home/movie-home.component.ts @@ -5,12 +5,12 @@ import { Observable } from 'rxjs'; @Component({ selector: 'app-movie-home', templateUrl: './movie-home.component.html', - styleUrls: ['./movie-home.component.css'] + styleUrls: ['./movie-home.component.css'], }) export class MovieHomeComponent implements OnInit { public movie$: Observable; - constructor(private movieQuery: MovieQuery) { } + constructor(private movieQuery: MovieQuery) {} ngOnInit() { this.movie$ = this.movieQuery.selectActive(); diff --git a/src/app/collection/movie-item/movie-item.component.html b/src/app/collection/movie-item/movie-item.component.html index 3d00f2e0..22f6ec5f 100644 --- a/src/app/collection/movie-item/movie-item.component.html +++ b/src/app/collection/movie-item/movie-item.component.html @@ -4,7 +4,9 @@

{{ movie.description }}

- + View diff --git a/src/app/collection/movie-item/movie-item.component.ts b/src/app/collection/movie-item/movie-item.component.ts index 5477276c..be3bd72f 100644 --- a/src/app/collection/movie-item/movie-item.component.ts +++ b/src/app/collection/movie-item/movie-item.component.ts @@ -1,11 +1,17 @@ -import { Component, Output, Input, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; +import { + Component, + Output, + Input, + EventEmitter, + ChangeDetectionStrategy, +} from '@angular/core'; import { Movie } from '../+state'; @Component({ selector: 'movie-item', templateUrl: './movie-item.component.html', styleUrls: ['./movie-item.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class MovieItemComponent { @Input() movie: Movie; diff --git a/src/app/collection/movie-list/movie-list.component.html b/src/app/collection/movie-list/movie-list.component.html index ceb17c94..daca7508 100644 --- a/src/app/collection/movie-list/movie-list.component.html +++ b/src/app/collection/movie-list/movie-list.component.html @@ -1,6 +1,4 @@ - - Loading - + Loading @@ -18,5 +16,4 @@
- - \ No newline at end of file + diff --git a/src/app/collection/movie-list/movie-list.component.ts b/src/app/collection/movie-list/movie-list.component.ts index 09202c46..4ec88f92 100644 --- a/src/app/collection/movie-list/movie-list.component.ts +++ b/src/app/collection/movie-list/movie-list.component.ts @@ -7,7 +7,7 @@ import { Router } from '@angular/router'; selector: 'movie-list', templateUrl: './movie-list.component.html', styleUrls: ['./movie-list.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class MovieListComponent implements OnInit { public movies$: Observable; @@ -17,7 +17,7 @@ export class MovieListComponent implements OnInit { private service: MovieService, private query: MovieQuery, private router: Router - ) { } + ) {} ngOnInit() { this.movies$ = this.query.selectAll(); diff --git a/src/app/collection/movie-view/movie-view.component.html b/src/app/collection/movie-view/movie-view.component.html index 47f2158d..6a5188eb 100644 --- a/src/app/collection/movie-view/movie-view.component.html +++ b/src/app/collection/movie-view/movie-view.component.html @@ -1,10 +1,7 @@ - - Loading - + Loading -
@@ -15,21 +12,35 @@

{{ movie.title }}

Select a Movie - - {{otherMovie.title}} + + {{ otherMovie.title }}
- diff --git a/src/app/collection/movie-view/movie-view.component.ts b/src/app/collection/movie-view/movie-view.component.ts index 9632fde4..9d9b85c9 100644 --- a/src/app/collection/movie-view/movie-view.component.ts +++ b/src/app/collection/movie-view/movie-view.component.ts @@ -7,15 +7,14 @@ import { Router, ActivatedRoute } from '@angular/router'; selector: 'movie-view', templateUrl: './movie-view.component.html', styleUrls: ['./movie-view.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class MovieViewComponent implements OnInit { - public movie$: Observable; public movies$: Observable; public loading$: Observable; - constructor(private query: MovieQuery, private router: Router) { } + constructor(private query: MovieQuery, private router: Router) {} ngOnInit() { this.movie$ = this.query.selectActive(); diff --git a/src/app/collection/movie.form.ts b/src/app/collection/movie.form.ts index 18686308..fc9812fe 100644 --- a/src/app/collection/movie.form.ts +++ b/src/app/collection/movie.form.ts @@ -4,7 +4,7 @@ export class MovieForm extends FormGroup { constructor() { super({ title: new FormControl(), - description: new FormControl() + description: new FormControl(), }); } } diff --git a/src/app/collection/movie.guard.ts b/src/app/collection/movie.guard.ts index 54e5b1ab..3a9f5ce6 100644 --- a/src/app/collection/movie.guard.ts +++ b/src/app/collection/movie.guard.ts @@ -1,6 +1,10 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot } from '@angular/router'; -import { CollectionGuard, CollectionGuardConfig, redirectIfEmpty } from 'akita-ng-fire'; +import { + CollectionGuard, + CollectionGuardConfig, + redirectIfEmpty, +} from 'akita-ng-fire'; import { MovieState, MovieService } from './+state'; // MovieListGuard is used for the route "movies/list" @@ -13,16 +17,15 @@ export class MovieListGuard extends CollectionGuard { // Sync to collection. If empty redirect to to 'movies/create' sync() { - return this.service.syncCollection('movies/').pipe( - redirectIfEmpty('movies/create') - ); + return this.service + .syncCollection('movies/') + .pipe(redirectIfEmpty('movies/create')); } } // ActiveMovieGuard is used for the route "movies/:id" @Injectable({ providedIn: 'root' }) export class ActiveMovieGuard extends CollectionGuard { - constructor(service: MovieService) { super(service); } diff --git a/src/app/collection/movie.module.ts b/src/app/collection/movie.module.ts index 10b4543b..ffd4fa72 100644 --- a/src/app/collection/movie.module.ts +++ b/src/app/collection/movie.module.ts @@ -32,14 +32,14 @@ import { MovieHomeComponent } from './movie-home/movie-home.component'; path: 'list', canActivate: [MovieListGuard], // Manage subscription canDeactivate: [MovieListGuard], // Manage unsubscription - component: MovieListComponent + component: MovieListComponent, }, { path: ':movieId', canActivate: [ActiveMovieGuard], // Manage subscription canDeactivate: [ActiveMovieGuard], // Manage unsubscription data: { - redirect: 'movies/list' // Redirect to movies/list if movieId not found + redirect: 'movies/list', // Redirect to movies/list if movieId not found }, component: MovieViewComponent, children: [ @@ -47,11 +47,14 @@ import { MovieHomeComponent } from './movie-home/movie-home.component'; { path: 'home', component: MovieHomeComponent }, { path: 'stakeholders', - loadChildren: () => import('../subcollection/stakeholder.module').then(m => m.StakeholderModule) - } - ] - } - ]) - ] + loadChildren: () => + import('../subcollection/stakeholder.module').then( + (m) => m.StakeholderModule + ), + }, + ], + }, + ]), + ], }) export class MovieModule {} diff --git a/src/app/dynamic-store/+state/marketplace.query.ts b/src/app/dynamic-store/+state/marketplace.query.ts index c43a2919..c2a4e4ff 100644 --- a/src/app/dynamic-store/+state/marketplace.query.ts +++ b/src/app/dynamic-store/+state/marketplace.query.ts @@ -4,9 +4,7 @@ import { Injectable } from '@angular/core'; @Injectable() export class MarketplaceQuery extends QueryEntity { - constructor(protected store: MarketplaceStore) { super(store); } - } diff --git a/src/app/dynamic-store/+state/marketplace.service.ts b/src/app/dynamic-store/+state/marketplace.service.ts index f6a18cb8..d60a4daa 100644 --- a/src/app/dynamic-store/+state/marketplace.service.ts +++ b/src/app/dynamic-store/+state/marketplace.service.ts @@ -5,9 +5,7 @@ import { CollectionConfig, CollectionService } from 'akita-ng-fire'; @Injectable({ providedIn: 'root' }) @CollectionConfig({ path: 'movies' }) export class MarketplaceService extends CollectionService { - constructor() { super(); } - } diff --git a/src/app/dynamic-store/+state/marketplace.store.ts b/src/app/dynamic-store/+state/marketplace.store.ts index a51cb226..710e119b 100644 --- a/src/app/dynamic-store/+state/marketplace.store.ts +++ b/src/app/dynamic-store/+state/marketplace.store.ts @@ -2,13 +2,13 @@ import { EntityState, ActiveState, EntityStore, guid } from '@datorama/akita'; import { Movie } from 'src/app/collection/+state'; import { Injectable } from '@angular/core'; -export interface MarketplaceState extends EntityState, ActiveState {} +export interface MarketplaceState + extends EntityState, + ActiveState {} @Injectable() export class MarketplaceStore extends EntityStore { - constructor() { super({}, { name: `marketplace-${guid()}` }); } - } diff --git a/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.html b/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.html index 575c4332..6ec291c9 100644 --- a/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.html +++ b/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.html @@ -1,4 +1,4 @@

{{ title }}

{{ movie.title }}

-
\ No newline at end of file + diff --git a/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.ts b/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.ts index 53f2491f..b7ee94b7 100644 --- a/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.ts +++ b/src/app/dynamic-store/marketplace-carousel/marketplace-carousel.component.ts @@ -9,10 +9,9 @@ import { Movie } from 'src/app/collection/+state'; selector: '[title] marketplace-carousel', templateUrl: './marketplace-carousel.component.html', styleUrls: ['./marketplace-carousel.component.css'], - providers: [MarketplaceStore, MarketplaceQuery] + providers: [MarketplaceStore, MarketplaceQuery], }) export class MarketplaceCarouselComponent implements OnInit, OnDestroy { - @Input() title: string; private sub: Subscription; public movies$: Observable; @@ -20,17 +19,17 @@ export class MarketplaceCarouselComponent implements OnInit, OnDestroy { constructor( private service: MarketplaceService, private query: MarketplaceQuery, - private store: MarketplaceStore, - ) { } + private store: MarketplaceStore + ) {} ngOnInit() { const storeName = this.store.storeName; - const queryFn = ref => ref.where('title', '==', this.title); + const queryFn = (ref) => ref.where('title', '==', this.title); this.sub = this.service.syncCollection(queryFn, { storeName }).subscribe(); this.movies$ = this.query.selectAll(); } ngOnDestroy(): void { - if(this.sub) this.sub.unsubscribe(); + if (this.sub) this.sub.unsubscribe(); } } diff --git a/src/app/dynamic-store/marketplace-home/marketplace-home.component.html b/src/app/dynamic-store/marketplace-home/marketplace-home.component.html index c0a5a7b3..48029add 100644 --- a/src/app/dynamic-store/marketplace-home/marketplace-home.component.html +++ b/src/app/dynamic-store/marketplace-home/marketplace-home.component.html @@ -5,4 +5,4 @@

Markeplace of movies

- \ No newline at end of file + diff --git a/src/app/dynamic-store/marketplace-home/marketplace-home.component.ts b/src/app/dynamic-store/marketplace-home/marketplace-home.component.ts index 778ad13a..bbeac8f8 100644 --- a/src/app/dynamic-store/marketplace-home/marketplace-home.component.ts +++ b/src/app/dynamic-store/marketplace-home/marketplace-home.component.ts @@ -8,12 +8,11 @@ import { Observable } from 'rxjs'; styleUrls: ['./marketplace-home.component.css'], }) export class MarketplaceHomeComponent implements OnInit { - public movies$: Observable; constructor(private movieQuery: MovieQuery) {} ngOnInit() { this.movies$ = this.movieQuery.selectAll(); - } + } } diff --git a/src/app/dynamic-store/marketplace.module.ts b/src/app/dynamic-store/marketplace.module.ts index 1e78cecb..5b96659d 100644 --- a/src/app/dynamic-store/marketplace.module.ts +++ b/src/app/dynamic-store/marketplace.module.ts @@ -12,8 +12,15 @@ import { MovieListGuard } from '../collection/movie.guard'; imports: [ CommonModule, MatListModule, - RouterModule.forChild([{ path: '', component: MarketplaceHomeComponent, canActivate: [MovieListGuard], canDeactivate: [MovieListGuard] }]) + RouterModule.forChild([ + { + path: '', + component: MarketplaceHomeComponent, + canActivate: [MovieListGuard], + canDeactivate: [MovieListGuard], + }, + ]), ], - declarations: [MarketplaceHomeComponent, MarketplaceCarouselComponent] + declarations: [MarketplaceHomeComponent, MarketplaceCarouselComponent], }) export class MarketplaceModule {} diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 5816e6dc..be404fbb 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -6,10 +6,12 @@

Welcome

Here you can see examples of apps using akita-ng-fire

- \ No newline at end of file + diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 8d631e9f..9ffc897c 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -3,6 +3,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-home', templateUrl: './home.component.html', - styleUrls: ['./home.component.css'] + styleUrls: ['./home.component.css'], }) export class HomeComponent {} diff --git a/src/app/many-active/+state/catalog.query.ts b/src/app/many-active/+state/catalog.query.ts index b85510cb..45a10754 100644 --- a/src/app/many-active/+state/catalog.query.ts +++ b/src/app/many-active/+state/catalog.query.ts @@ -4,9 +4,7 @@ import { CatalogStore, CatalogState } from './catalog.store'; @Injectable({ providedIn: 'root' }) export class CatalogQuery extends QueryEntity { - constructor(protected store: CatalogStore) { super(store); } - } diff --git a/src/app/many-active/+state/catalog.service.ts b/src/app/many-active/+state/catalog.service.ts index f155e5ce..c3f135e5 100644 --- a/src/app/many-active/+state/catalog.service.ts +++ b/src/app/many-active/+state/catalog.service.ts @@ -5,9 +5,7 @@ import { CollectionConfig, CollectionService } from 'akita-ng-fire'; @Injectable({ providedIn: 'root' }) @CollectionConfig({ path: 'movies' }) export class CatalogService extends CollectionService { - constructor(store: CatalogStore) { super(store); } - } diff --git a/src/app/many-active/+state/catalog.store.ts b/src/app/many-active/+state/catalog.store.ts index 02a1ec95..b269626e 100644 --- a/src/app/many-active/+state/catalog.store.ts +++ b/src/app/many-active/+state/catalog.store.ts @@ -1,16 +1,20 @@ import { Injectable } from '@angular/core'; -import { EntityState, EntityStore, StoreConfig, MultiActiveState } from '@datorama/akita'; +import { + EntityState, + EntityStore, + StoreConfig, + MultiActiveState, +} from '@datorama/akita'; import { Movie } from 'src/app/collection/+state'; -export interface CatalogState extends EntityState, MultiActiveState {} +export interface CatalogState + extends EntityState, + MultiActiveState {} @Injectable({ providedIn: 'root' }) @StoreConfig({ name: 'catalog' }) export class CatalogStore extends EntityStore { - constructor() { super({ active: [] }); } - } - diff --git a/src/app/many-active/catalog-list/catalog-list.component.html b/src/app/many-active/catalog-list/catalog-list.component.html index 8f9aaf10..2519e9a4 100644 --- a/src/app/many-active/catalog-list/catalog-list.component.html +++ b/src/app/many-active/catalog-list/catalog-list.component.html @@ -6,7 +6,7 @@ - {{movie.title}} + {{ movie.title }} diff --git a/src/app/many-active/catalog-list/catalog-list.component.ts b/src/app/many-active/catalog-list/catalog-list.component.ts index adf4e8c8..9039f286 100644 --- a/src/app/many-active/catalog-list/catalog-list.component.ts +++ b/src/app/many-active/catalog-list/catalog-list.component.ts @@ -8,10 +8,9 @@ import { map } from 'rxjs/operators'; @Component({ selector: 'catalog-list', templateUrl: './catalog-list.component.html', - styleUrls: ['./catalog-list.component.css'] + styleUrls: ['./catalog-list.component.css'], }) export class CatalogListComponent implements OnInit, OnDestroy { - private sub: Subscription; public movies$: Observable; public selectionCount$: Observable; @@ -19,13 +18,15 @@ export class CatalogListComponent implements OnInit, OnDestroy { constructor( private service: CatalogService, private store: CatalogStore, - private query: CatalogQuery, - ) { } + private query: CatalogQuery + ) {} ngOnInit() { this.sub = this.service.syncCollection().subscribe(); this.movies$ = this.query.selectAll(); - this.selectionCount$ = this.query.selectActive().pipe(map(actives => actives.length)); + this.selectionCount$ = this.query + .selectActive() + .pipe(map((actives) => actives.length)); } ngOnDestroy() { diff --git a/src/app/many-active/catalog-selection/catalog-selection.component.html b/src/app/many-active/catalog-selection/catalog-selection.component.html index fd2d5173..6e51cd1f 100644 --- a/src/app/many-active/catalog-selection/catalog-selection.component.html +++ b/src/app/many-active/catalog-selection/catalog-selection.component.html @@ -5,7 +5,7 @@ - {{movie.title}} + {{ movie.title }} diff --git a/src/app/many-active/catalog-selection/catalog-selection.component.ts b/src/app/many-active/catalog-selection/catalog-selection.component.ts index 33049d54..c6c9e4bb 100644 --- a/src/app/many-active/catalog-selection/catalog-selection.component.ts +++ b/src/app/many-active/catalog-selection/catalog-selection.component.ts @@ -6,17 +6,13 @@ import { CatalogQuery, CatalogService } from '../+state'; @Component({ selector: 'catalog-selection', templateUrl: './catalog-selection.component.html', - styleUrls: ['./catalog-selection.component.css'] + styleUrls: ['./catalog-selection.component.css'], }) export class CatalogSelectionComponent implements OnInit, OnDestroy { - private sub: Subscription; public movies$: Observable; - constructor( - private service: CatalogService, - private query: CatalogQuery - ) { } + constructor(private service: CatalogService, private query: CatalogQuery) {} ngOnInit() { this.sub = this.service.syncManyDocs(this.query.getActiveId()).subscribe(); @@ -26,5 +22,4 @@ export class CatalogSelectionComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.sub.unsubscribe(); } - } diff --git a/src/app/many-active/catalog.module.ts b/src/app/many-active/catalog.module.ts index 91899aa8..6b85d7dc 100644 --- a/src/app/many-active/catalog.module.ts +++ b/src/app/many-active/catalog.module.ts @@ -23,6 +23,6 @@ import { MatButtonModule } from '@angular/material/button'; { path: 'list', component: CatalogListComponent }, { path: 'selection', component: CatalogSelectionComponent }, ]), - ] + ], }) -export class CatalogModule { } +export class CatalogModule {} diff --git a/src/app/material.module.ts b/src/app/material.module.ts index b6cac289..2a853037 100644 --- a/src/app/material.module.ts +++ b/src/app/material.module.ts @@ -25,6 +25,6 @@ const material = [ ]; @NgModule({ - exports: material + exports: material, }) export class MaterialModule {} diff --git a/src/app/real-time/+state/vehicle.query.ts b/src/app/real-time/+state/vehicle.query.ts index 28fe431d..41250e46 100644 --- a/src/app/real-time/+state/vehicle.query.ts +++ b/src/app/real-time/+state/vehicle.query.ts @@ -4,9 +4,7 @@ import { VehicleStore, VehicleState } from './vehicle.store'; @Injectable({ providedIn: 'root' }) export class VehicleQuery extends QueryEntity { - constructor(protected store: VehicleStore) { super(store); } - } diff --git a/src/app/real-time/+state/vehicle.service.ts b/src/app/real-time/+state/vehicle.service.ts index d622a5bf..83ab7e3a 100644 --- a/src/app/real-time/+state/vehicle.service.ts +++ b/src/app/real-time/+state/vehicle.service.ts @@ -1,11 +1,10 @@ import { Injectable } from '@angular/core'; -import { RealTimeConfig, RealTimeService } from 'akita-ng-fire/rtdb' +import { RealTimeConfig, RealTimeService } from 'akita-ng-fire/rtdb'; import { VehicleStore, VehicleState } from './vehicle.store'; @Injectable({ providedIn: 'root' }) @RealTimeConfig({ nodeName: 'vehicles' }) export class VehicleService extends RealTimeService { - constructor(store: VehicleStore) { super(store); } diff --git a/src/app/real-time/+state/vehicle.store.ts b/src/app/real-time/+state/vehicle.store.ts index ff1f4148..53974f02 100644 --- a/src/app/real-time/+state/vehicle.store.ts +++ b/src/app/real-time/+state/vehicle.store.ts @@ -1,20 +1,24 @@ import { Injectable } from '@angular/core'; -import { EntityStore, StoreConfig, EntityState, ActiveState } from '@datorama/akita'; +import { + EntityStore, + StoreConfig, + EntityState, + ActiveState, +} from '@datorama/akita'; interface Vehicle { name: string; tires: number; } -export interface VehicleState extends EntityState, ActiveState {} +export interface VehicleState + extends EntityState, + ActiveState {} @Injectable({ providedIn: 'root' }) @StoreConfig({ name: 'vehicle' }) export class VehicleStore extends EntityStore { - constructor() { super(); } - } - diff --git a/src/app/real-time/vehicle.component.html b/src/app/real-time/vehicle.component.html index 010d4578..157fb857 100644 --- a/src/app/real-time/vehicle.component.html +++ b/src/app/real-time/vehicle.component.html @@ -1,14 +1,22 @@

Vehicles

Add new Vehicle

- - + +
- - {{vehicle.name}} - {{vehicle.tires}} - - -
\ No newline at end of file + + {{ vehicle.name }} - {{ vehicle.tires }} + + +
diff --git a/src/app/real-time/vehicle.component.ts b/src/app/real-time/vehicle.component.ts index eb0df44f..cfba7175 100644 --- a/src/app/real-time/vehicle.component.ts +++ b/src/app/real-time/vehicle.component.ts @@ -1,40 +1,39 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; import { VehicleService } from './+state/vehicle.service'; -import { VehicleQuery} from './+state/vehicle.query'; +import { VehicleQuery } from './+state/vehicle.query'; import { Subscription } from 'rxjs'; @Component({ - selector: 'vehicle-list', - templateUrl: 'vehicle.component.html' + selector: 'vehicle-list', + templateUrl: 'vehicle.component.html', }) export class VehicleComponent implements OnInit, OnDestroy { + vehicles$ = this.query.selectAll(); - vehicles$ = this.query.selectAll(); + form = new FormGroup({ + name: new FormControl(), + tires: new FormControl(), + }); - form = new FormGroup({ - name: new FormControl(), - tires: new FormControl() - }) + sub: Subscription; - sub: Subscription; + constructor(private service: VehicleService, private query: VehicleQuery) {} - constructor(private service: VehicleService, private query: VehicleQuery) { } + ngOnInit() { + this.sub = this.service.syncNodeWithStore().subscribe(); + this.vehicles$.subscribe(console.log); + } - ngOnInit() { - this.sub = this.service.syncNodeWithStore().subscribe() - this.vehicles$.subscribe(console.log) - } + addVehicle() { + this.service.add(this.form.value); + } - addVehicle() { - this.service.add(this.form.value) - } + removeVehicle(id: string) { + this.service.remove(id); + } - removeVehicle(id: string) { - this.service.remove(id); - } - - ngOnDestroy() { - this.sub?.unsubscribe(); - } -} \ No newline at end of file + ngOnDestroy() { + this.sub?.unsubscribe(); + } +} diff --git a/src/app/real-time/vehicle.module.ts b/src/app/real-time/vehicle.module.ts index ce0ebb8e..8341bdbb 100644 --- a/src/app/real-time/vehicle.module.ts +++ b/src/app/real-time/vehicle.module.ts @@ -6,9 +6,11 @@ import { RouterModule } from '@angular/router'; import { VehicleComponent } from './vehicle.component'; @NgModule({ - imports: [CommonModule, - RouterModule.forChild([{ path: '', component: VehicleComponent }]), - ReactiveFormsModule], - declarations: [VehicleComponent], + imports: [ + CommonModule, + RouterModule.forChild([{ path: '', component: VehicleComponent }]), + ReactiveFormsModule, + ], + declarations: [VehicleComponent], }) -export class VehicleModule { } +export class VehicleModule {} diff --git a/src/app/subcollection/+state/stakeholder.model.ts b/src/app/subcollection/+state/stakeholder.model.ts index db08d7c6..688ed001 100644 --- a/src/app/subcollection/+state/stakeholder.model.ts +++ b/src/app/subcollection/+state/stakeholder.model.ts @@ -11,6 +11,6 @@ export interface Stakeholder { export function createStakeholder(params: Partial) { return { name: 'Default Name', - ...params + ...params, } as Stakeholder; } diff --git a/src/app/subcollection/+state/stakeholder.query.ts b/src/app/subcollection/+state/stakeholder.query.ts index 0b18ca4b..982374ca 100644 --- a/src/app/subcollection/+state/stakeholder.query.ts +++ b/src/app/subcollection/+state/stakeholder.query.ts @@ -4,9 +4,7 @@ import { StakeholderStore, StakeholderState } from './stakeholder.store'; @Injectable({ providedIn: 'root' }) export class StakeholderQuery extends QueryEntity { - constructor(protected store: StakeholderStore) { super(store); } - } diff --git a/src/app/subcollection/+state/stakeholder.service.ts b/src/app/subcollection/+state/stakeholder.service.ts index 22fcc0b4..d0aaddb2 100644 --- a/src/app/subcollection/+state/stakeholder.service.ts +++ b/src/app/subcollection/+state/stakeholder.service.ts @@ -6,13 +6,15 @@ import { StakeholderStore, StakeholderState } from './stakeholder.store'; @Injectable({ providedIn: 'root' }) @CollectionConfig({ path: 'movies/:movieId/stakeholders' }) export class StakeholderService extends CollectionService { - constructor(store: StakeholderStore) { super(store); } formatFromFirestore(stakeholder: Readonly) { - const alteredStakeholder = { ...stakeholder, name: `The original name was ${stakeholder.name}, but now its formatFromFirestore` } + const alteredStakeholder = { + ...stakeholder, + name: `The original name was ${stakeholder.name}, but now its formatFromFirestore`, + }; return alteredStakeholder; } } diff --git a/src/app/subcollection/+state/stakeholder.store.ts b/src/app/subcollection/+state/stakeholder.store.ts index 8f64d585..74bebe82 100644 --- a/src/app/subcollection/+state/stakeholder.store.ts +++ b/src/app/subcollection/+state/stakeholder.store.ts @@ -1,16 +1,20 @@ import { Injectable } from '@angular/core'; -import { EntityStore, StoreConfig, EntityState, ActiveState } from '@datorama/akita'; +import { + EntityStore, + StoreConfig, + EntityState, + ActiveState, +} from '@datorama/akita'; import { Stakeholder } from './stakeholder.model'; -export interface StakeholderState extends EntityState, ActiveState {} +export interface StakeholderState + extends EntityState, + ActiveState {} @Injectable({ providedIn: 'root' }) @StoreConfig({ name: 'stakeholder', resettable: true }) export class StakeholderStore extends EntityStore { - constructor() { super(); } - } - diff --git a/src/app/subcollection/stakeholder-create/stakeholder-create.component.ts b/src/app/subcollection/stakeholder-create/stakeholder-create.component.ts index 5957e6a3..5113c07e 100644 --- a/src/app/subcollection/stakeholder-create/stakeholder-create.component.ts +++ b/src/app/subcollection/stakeholder-create/stakeholder-create.component.ts @@ -7,7 +7,7 @@ import { StakeholderForm } from '../stakeholder.form'; selector: 'stakeholder-create', templateUrl: './stakeholder-create.component.html', styleUrls: ['./stakeholder-create.component.css'], - changeDetection: ChangeDetectionStrategy.Default + changeDetection: ChangeDetectionStrategy.Default, }) export class StakeholderCreateComponent { public form = new StakeholderForm(); @@ -16,12 +16,12 @@ export class StakeholderCreateComponent { private service: StakeholderService, private routes: ActivatedRoute, private router: Router - ) { } + ) {} async create() { const { movieId } = this.routes.snapshot.params; const stakeholder = createStakeholder(this.form.value); - await this.service.add(stakeholder, { params: { movieId }}); + await this.service.add(stakeholder, { params: { movieId } }); this.router.navigate(['../list'], { relativeTo: this.routes }); } } diff --git a/src/app/subcollection/stakeholder-edit/stakeholder-edit.component.ts b/src/app/subcollection/stakeholder-edit/stakeholder-edit.component.ts index 773d5793..3cc671d2 100644 --- a/src/app/subcollection/stakeholder-edit/stakeholder-edit.component.ts +++ b/src/app/subcollection/stakeholder-edit/stakeholder-edit.component.ts @@ -8,10 +8,9 @@ import { ActivatedRoute, Router } from '@angular/router'; @Component({ selector: 'stakeholder-edit', templateUrl: './stakeholder-edit.component.html', - styleUrls: ['./stakeholder-edit.component.css'] + styleUrls: ['./stakeholder-edit.component.css'], }) export class StakeholderEditComponent implements OnInit, OnDestroy { - private subscription: Subscription; public stakeholder$: Observable; public form = new StakeholderForm(); @@ -21,13 +20,14 @@ export class StakeholderEditComponent implements OnInit, OnDestroy { private query: StakeholderQuery, private routes: ActivatedRoute, private router: Router - ) { } + ) {} ngOnInit() { this.stakeholder$ = this.form.valueChanges.pipe(startWith(this.form.value)); - this.subscription = this.query.selectActive().pipe( - filter(value => !!value), - ).subscribe(stakeholder => this.form.patchValue(stakeholder)); + this.subscription = this.query + .selectActive() + .pipe(filter((value) => !!value)) + .subscribe((stakeholder) => this.form.patchValue(stakeholder)); } ngOnDestroy() { @@ -41,5 +41,4 @@ export class StakeholderEditComponent implements OnInit, OnDestroy { await this.service.update(id, update, { params: { movieId } }); this.router.navigate(['../../list'], { relativeTo: this.routes }); } - } diff --git a/src/app/subcollection/stakeholder-form/stakeholder-form.component.html b/src/app/subcollection/stakeholder-form/stakeholder-form.component.html index 6faa470f..0e85e1ed 100644 --- a/src/app/subcollection/stakeholder-form/stakeholder-form.component.html +++ b/src/app/subcollection/stakeholder-form/stakeholder-form.component.html @@ -1,6 +1,12 @@
- +
diff --git a/src/app/subcollection/stakeholder-form/stakeholder-form.component.ts b/src/app/subcollection/stakeholder-form/stakeholder-form.component.ts index bd80aab6..9f91cf8e 100644 --- a/src/app/subcollection/stakeholder-form/stakeholder-form.component.ts +++ b/src/app/subcollection/stakeholder-form/stakeholder-form.component.ts @@ -1,14 +1,18 @@ -import { Component, EventEmitter, Output, ChangeDetectionStrategy } from '@angular/core'; +import { + Component, + EventEmitter, + Output, + ChangeDetectionStrategy, +} from '@angular/core'; import { ControlContainer } from '@angular/forms'; @Component({ selector: '[formGroup] stakeholder-form, [formGroupName] stakeholder-form', templateUrl: './stakeholder-form.component.html', styleUrls: ['./stakeholder-form.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class StakeholderFormComponent { - @Output() create = new EventEmitter(); constructor(private controlContainer: ControlContainer) {} @@ -16,5 +20,4 @@ export class StakeholderFormComponent { get control() { return this.controlContainer.control; } - } diff --git a/src/app/subcollection/stakeholder-list/stakeholder-list.component.ts b/src/app/subcollection/stakeholder-list/stakeholder-list.component.ts index c6106555..0d4d1439 100644 --- a/src/app/subcollection/stakeholder-list/stakeholder-list.component.ts +++ b/src/app/subcollection/stakeholder-list/stakeholder-list.component.ts @@ -5,19 +5,16 @@ import { Observable } from 'rxjs'; @Component({ selector: 'app-stakeholder-list', templateUrl: './stakeholder-list.component.html', - styleUrls: ['./stakeholder-list.component.css'] + styleUrls: ['./stakeholder-list.component.css'], }) export class StakeholderListComponent implements OnInit { public stakeholders$: Observable; public loading$: Observable; - constructor( - private query: StakeholderQuery, - ) {} + constructor(private query: StakeholderQuery) {} ngOnInit() { this.stakeholders$ = this.query.selectAll(); this.loading$ = this.query.selectLoading(); } - } diff --git a/src/app/subcollection/stakeholder.guard.ts b/src/app/subcollection/stakeholder.guard.ts index 339d82c5..43a241b2 100644 --- a/src/app/subcollection/stakeholder.guard.ts +++ b/src/app/subcollection/stakeholder.guard.ts @@ -1,7 +1,15 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot } from '@angular/router'; -import { CollectionGuard, redirectIfEmpty, CollectionGuardConfig } from 'akita-ng-fire'; -import { StakeholderService, StakeholderQuery, StakeholderState } from './+state'; +import { + CollectionGuard, + redirectIfEmpty, + CollectionGuardConfig, +} from 'akita-ng-fire'; +import { + StakeholderService, + StakeholderQuery, + StakeholderState, +} from './+state'; @Injectable({ providedIn: 'root' }) export class StakeholderGuard extends CollectionGuard { @@ -16,18 +24,16 @@ export class StakeholderGuard extends CollectionGuard { sync(next: ActivatedRouteSnapshot) { const { movieId } = next.params; - return this.service.syncCollection({ params: { movieId } }).pipe( - redirectIfEmpty(`/movies/${movieId}/stakeholders/create`) - ); + return this.service + .syncCollection({ params: { movieId } }) + .pipe(redirectIfEmpty(`/movies/${movieId}/stakeholders/create`)); } } - // ActiveMovieGuard is used for the route "movies/:id" @Injectable({ providedIn: 'root' }) @CollectionGuardConfig({ awaitSync: true }) export class ActiveStakeholderGuard extends CollectionGuard { - constructor(service: StakeholderService) { super(service); } @@ -35,6 +41,9 @@ export class ActiveStakeholderGuard extends CollectionGuard { // Sync and set active sync(next: ActivatedRouteSnapshot) { const { movieId, stakeholderId } = next.params; - return this.service.syncActive({ id: stakeholderId }, { params: {movieId}}); + return this.service.syncActive( + { id: stakeholderId }, + { params: { movieId } } + ); } } diff --git a/src/app/subcollection/stakeholder.module.ts b/src/app/subcollection/stakeholder.module.ts index cee73e4a..612bfdad 100644 --- a/src/app/subcollection/stakeholder.module.ts +++ b/src/app/subcollection/stakeholder.module.ts @@ -11,7 +11,12 @@ import { StakeholderFormComponent } from './stakeholder-form/stakeholder-form.co import { StakeholderEditComponent } from './stakeholder-edit/stakeholder-edit.component'; @NgModule({ - declarations: [StakeholderListComponent, StakeholderCreateComponent, StakeholderFormComponent, StakeholderEditComponent], + declarations: [ + StakeholderListComponent, + StakeholderCreateComponent, + StakeholderFormComponent, + StakeholderEditComponent, + ], imports: [ CommonModule, MaterialModule, @@ -23,17 +28,15 @@ import { StakeholderEditComponent } from './stakeholder-edit/stakeholder-edit.co path: 'list', component: StakeholderListComponent, canActivate: [StakeholderGuard], - canDeactivate: [StakeholderGuard] + canDeactivate: [StakeholderGuard], }, { path: ':stakeholderId', canActivate: [ActiveStakeholderGuard], canDeactivate: [ActiveStakeholderGuard], - children: [ - { path: 'edit', component: StakeholderEditComponent } - ] - } - ]) - ] + children: [{ path: 'edit', component: StakeholderEditComponent }], + }, + ]), + ], }) -export class StakeholderModule { } +export class StakeholderModule {} diff --git a/src/app/sync-many-ids/+state/organization.model.ts b/src/app/sync-many-ids/+state/organization.model.ts index ed1fe367..d85c4ddd 100644 --- a/src/app/sync-many-ids/+state/organization.model.ts +++ b/src/app/sync-many-ids/+state/organization.model.ts @@ -7,10 +7,12 @@ export interface Organization { /** * A factory function that creates Organization */ -export function createOrganization(params: Partial): Organization { +export function createOrganization( + params: Partial +): Organization { return { movieIds: [], name: 'My Organization', - ...params + ...params, }; } diff --git a/src/app/sync-many-ids/+state/organization.query.ts b/src/app/sync-many-ids/+state/organization.query.ts index 6772044f..f8ad7025 100644 --- a/src/app/sync-many-ids/+state/organization.query.ts +++ b/src/app/sync-many-ids/+state/organization.query.ts @@ -4,9 +4,7 @@ import { OrganizationStore, OrganizationState } from './organization.store'; @Injectable({ providedIn: 'root' }) export class OrganizationQuery extends QueryEntity { - constructor(protected store: OrganizationStore) { super(store); } - } diff --git a/src/app/sync-many-ids/+state/organization.service.ts b/src/app/sync-many-ids/+state/organization.service.ts index 48861428..7741dd2c 100644 --- a/src/app/sync-many-ids/+state/organization.service.ts +++ b/src/app/sync-many-ids/+state/organization.service.ts @@ -7,7 +7,6 @@ import { Organization } from './organization.model'; @Injectable({ providedIn: 'root' }) @CollectionConfig({ path: 'organizations' }) export class OrganizationService extends CollectionService { - constructor(store: OrganizationStore, private authService: AuthService) { super(store); } @@ -16,12 +15,12 @@ export class OrganizationService extends CollectionService { return this.authService.update(({ organizationIds }) => { if (organizationIds?.length) { return { - organizationIds: [...organizationIds, id] - } + organizationIds: [...organizationIds, id], + }; } else { return { - organizationIds: [id] - } + organizationIds: [id], + }; } }); } diff --git a/src/app/sync-many-ids/+state/organization.store.ts b/src/app/sync-many-ids/+state/organization.store.ts index fa83369b..35de3e5d 100644 --- a/src/app/sync-many-ids/+state/organization.store.ts +++ b/src/app/sync-many-ids/+state/organization.store.ts @@ -1,8 +1,15 @@ import { Injectable } from '@angular/core'; import { Organization } from './organization.model'; -import { EntityState, ActiveState, EntityStore, StoreConfig } from '@datorama/akita'; +import { + EntityState, + ActiveState, + EntityStore, + StoreConfig, +} from '@datorama/akita'; -export interface OrganizationState extends EntityState, ActiveState {} +export interface OrganizationState + extends EntityState, + ActiveState {} @Injectable({ providedIn: 'root' }) @StoreConfig({ name: 'organization' }) diff --git a/src/app/sync-many-ids/organization-create/organization-create.component.html b/src/app/sync-many-ids/organization-create/organization-create.component.html index 2ae77ca8..24fc8bd9 100644 --- a/src/app/sync-many-ids/organization-create/organization-create.component.html +++ b/src/app/sync-many-ids/organization-create/organization-create.component.html @@ -2,4 +2,6 @@ Name of the organization - + diff --git a/src/app/sync-many-ids/organization-create/organization-create.component.ts b/src/app/sync-many-ids/organization-create/organization-create.component.ts index 33dc0d83..b72e56c4 100644 --- a/src/app/sync-many-ids/organization-create/organization-create.component.ts +++ b/src/app/sync-many-ids/organization-create/organization-create.component.ts @@ -6,18 +6,14 @@ import { OrganizationService } from '../+state/organization.service'; @Component({ selector: 'organization-create', templateUrl: './organization-create.component.html', - styleUrls: ['./organization-create.component.css'] + styleUrls: ['./organization-create.component.css'], }) export class OrganizationCreateComponent { - public formName = new FormControl(''); - constructor( - private service: OrganizationService, - private router: Router - ) { - this.service.getValue().then(console.log) - this.service.valueChanges().subscribe(console.log) + constructor(private service: OrganizationService, private router: Router) { + this.service.getValue().then(console.log); + this.service.valueChanges().subscribe(console.log); } create() { diff --git a/src/app/sync-many-ids/organization-list/organization-list.component.ts b/src/app/sync-many-ids/organization-list/organization-list.component.ts index 8a1b6901..17bc0179 100644 --- a/src/app/sync-many-ids/organization-list/organization-list.component.ts +++ b/src/app/sync-many-ids/organization-list/organization-list.component.ts @@ -6,13 +6,12 @@ import { Observable } from 'rxjs'; @Component({ selector: 'organization-list', templateUrl: './organization-list.component.html', - styleUrls: ['./organization-list.component.css'] + styleUrls: ['./organization-list.component.css'], }) export class OrganizationListComponent implements OnInit { - public organizations$: Observable; - constructor(private query: OrganizationQuery) { } + constructor(private query: OrganizationQuery) {} ngOnInit() { this.organizations$ = this.query.selectAll(); diff --git a/src/app/sync-many-ids/organization-view/organization-view.component.css b/src/app/sync-many-ids/organization-view/organization-view.component.css index 606f01e2..5353bc22 100644 --- a/src/app/sync-many-ids/organization-view/organization-view.component.css +++ b/src/app/sync-many-ids/organization-view/organization-view.component.css @@ -1,4 +1,5 @@ -mat-toolbar, .title { +mat-toolbar, +.title { display: flex; align-items: center; justify-content: space-between; diff --git a/src/app/sync-many-ids/organization-view/organization-view.component.html b/src/app/sync-many-ids/organization-view/organization-view.component.html index 9ef8f52c..0a4413ef 100644 --- a/src/app/sync-many-ids/organization-view/organization-view.component.html +++ b/src/app/sync-many-ids/organization-view/organization-view.component.html @@ -6,7 +6,9 @@

{{ org.name }}

- {{ organization.name }} + + {{ organization.name }}
@@ -16,11 +18,15 @@

{{ org.name }}

Add/Remove a movie with its id

MovieId - +
- - + +
diff --git a/src/app/sync-many-ids/organization-view/organization-view.component.ts b/src/app/sync-many-ids/organization-view/organization-view.component.ts index 73708648..c4645ea5 100644 --- a/src/app/sync-many-ids/organization-view/organization-view.component.ts +++ b/src/app/sync-many-ids/organization-view/organization-view.component.ts @@ -11,10 +11,9 @@ import { Router, ActivatedRoute } from '@angular/router'; @Component({ selector: 'organization-view', templateUrl: './organization-view.component.html', - styleUrls: ['./organization-view.component.css'] + styleUrls: ['./organization-view.component.css'], }) export class OrganizationViewComponent implements OnInit, OnDestroy { - private sub: Subscription; public organizationList$: Observable; public organization$: Observable; @@ -28,16 +27,19 @@ export class OrganizationViewComponent implements OnInit, OnDestroy { private query: OrganizationQuery, private router: Router, private routes: ActivatedRoute - ) { } + ) {} ngOnInit() { this.organizationList$ = this.query.selectAll(); this.organization$ = this.query.selectActive(); this.movies$ = this.movieQuery.selectAll(); - this.sub = this.query.selectActive().pipe( - filter(org => !!org), - switchMap(org => this.movieService.syncManyDocs(org.movieIds)), - ).subscribe(); + this.sub = this.query + .selectActive() + .pipe( + filter((org) => !!org), + switchMap((org) => this.movieService.syncManyDocs(org.movieIds)) + ) + .subscribe(); } ngOnDestroy(): void { @@ -57,7 +59,7 @@ export class OrganizationViewComponent implements OnInit, OnDestroy { async removeMovie(org: Organization) { const id = this.movieIdForm.value; - const movieIds = org.movieIds.filter(movieId => movieId !== id); + const movieIds = org.movieIds.filter((movieId) => movieId !== id); await this.service.update(org.id, { movieIds }); this.movieIdForm.reset(); } diff --git a/src/app/sync-many-ids/organization.guard.ts b/src/app/sync-many-ids/organization.guard.ts index 74b75801..5b4c2009 100644 --- a/src/app/sync-many-ids/organization.guard.ts +++ b/src/app/sync-many-ids/organization.guard.ts @@ -24,10 +24,8 @@ export class OrganizationListGuard extends CollectionGuard { } } - @Injectable({ providedIn: 'root' }) export class ActiveOrganizationGuard extends CollectionGuard { - constructor(service: OrganizationService) { super(service); } diff --git a/src/app/sync-many-ids/organization.module.ts b/src/app/sync-many-ids/organization.module.ts index 5efbf0f2..4aff3480 100644 --- a/src/app/sync-many-ids/organization.module.ts +++ b/src/app/sync-many-ids/organization.module.ts @@ -10,7 +10,10 @@ import { MatButtonModule } from '@angular/material/button'; import { MatToolbarModule } from '@angular/material/toolbar'; import { MatSelectModule } from '@angular/material/select'; -import { OrganizationListGuard, ActiveOrganizationGuard } from './organization.guard'; +import { + OrganizationListGuard, + ActiveOrganizationGuard, +} from './organization.guard'; import { OrganizationCreateComponent } from './organization-create/organization-create.component'; import { OrganizationListComponent } from './organization-list/organization-list.component'; import { OrganizationViewComponent } from './organization-view/organization-view.component'; @@ -41,8 +44,12 @@ import { AuthGuard } from '../auth/auth.guard'; canActivate: [ActiveOrganizationGuard], canDeactivate: [ActiveOrganizationGuard], }, - ]) + ]), + ], + declarations: [ + OrganizationCreateComponent, + OrganizationListComponent, + OrganizationViewComponent, ], - declarations: [OrganizationCreateComponent, OrganizationListComponent, OrganizationViewComponent] }) -export class OrganizationModule { } +export class OrganizationModule {} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 00b4d13e..9839ccfa 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,12 +1,12 @@ export const environment = { production: true, firebase: { - apiKey: "AIzaSyD8fRfGLDsh8u8pXoKwzxiDHMqg-b1IpN0", - authDomain: "akita-ng-fire-f93f0.firebaseapp.com", - databaseURL: "https://akita-ng-fire-f93f0.firebaseio.com", - projectId: "akita-ng-fire-f93f0", - storageBucket: "akita-ng-fire-f93f0.appspot.com", - messagingSenderId: "561612331472", - appId: "1:561612331472:web:307acb3b5d26ec0cb8c1d5" - } + apiKey: 'AIzaSyD8fRfGLDsh8u8pXoKwzxiDHMqg-b1IpN0', + authDomain: 'akita-ng-fire-f93f0.firebaseapp.com', + databaseURL: 'https://akita-ng-fire-f93f0.firebaseio.com', + projectId: 'akita-ng-fire-f93f0', + storageBucket: 'akita-ng-fire-f93f0.appspot.com', + messagingSenderId: '561612331472', + appId: '1:561612331472:web:307acb3b5d26ec0cb8c1d5', + }, }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index aba60c71..a3b92151 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,18 +5,18 @@ export const environment = { production: false, firebase: { - apiKey: "AIzaSyD8fRfGLDsh8u8pXoKwzxiDHMqg-b1IpN0", - authDomain: "akita-ng-fire-f93f0.firebaseapp.com", - databaseURL: "https://akita-ng-fire-f93f0.firebaseio.com", - projectId: "akita-ng-fire-f93f0", - storageBucket: "akita-ng-fire-f93f0.appspot.com", - messagingSenderId: "561612331472", - appId: "1:561612331472:web:307acb3b5d26ec0cb8c1d5" + apiKey: 'AIzaSyD8fRfGLDsh8u8pXoKwzxiDHMqg-b1IpN0', + authDomain: 'akita-ng-fire-f93f0.firebaseapp.com', + databaseURL: 'https://akita-ng-fire-f93f0.firebaseio.com', + projectId: 'akita-ng-fire-f93f0', + storageBucket: 'akita-ng-fire-f93f0.appspot.com', + messagingSenderId: '561612331472', + appId: '1:561612331472:web:307acb3b5d26ec0cb8c1d5', }, firestoreSettings: { host: 'localhost:8080', - ssl: false - } + ssl: false, + }, }; /* diff --git a/src/index.html b/src/index.html index f4251618..5ef7d6e1 100644 --- a/src/index.html +++ b/src/index.html @@ -1,16 +1,22 @@ - + - - - AkitaFirebase - + + + AkitaFirebase + - - - - - - - - + + + + + + + + diff --git a/src/main.ts b/src/main.ts index 7bba85eb..6ed3852e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,3 @@ - import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; @@ -13,5 +12,6 @@ if (environment.production) { akitaDevtools(); } -platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.error(err)); +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((err) => console.error(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts index e484510f..3eb385e4 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -55,8 +55,7 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js'; // Included with Angular CLI. - +import 'zone.js'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS diff --git a/src/styles.scss b/src/styles.scss index 0d6081bd..75f446f8 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,7 +1,13 @@ /* You can add global styles to this file, and also import other style files */ -html, body { height: 100%; } -body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } +html, +body { + height: 100%; +} +body { + margin: 0; + font-family: Roboto, 'Helvetica Neue', sans-serif; +} a { text-decoration: none; diff --git a/src/test.ts b/src/test.ts index a6f15af3..89d92899 100644 --- a/src/test.ts +++ b/src/test.ts @@ -4,7 +4,7 @@ import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, - platformBrowserDynamicTesting + platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; declare const require: any;