Skip to content

Commit

Permalink
Add angular query devtools for development (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich authored Sep 14, 2024
1 parent 169fb03 commit 4744440
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions webapp/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@if (isDevMode()) {
<angular-query-devtools />
}
<div class="flex flex-col min-h-dvh">
<header class="container flex items-center justify-between pt-4">
<a class="flex gap-2 items-center hover:text-muted-foreground" routerLink="/">
Expand Down
11 changes: 8 additions & 3 deletions webapp/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { Component } from '@angular/core';
import { Component, isDevMode } from '@angular/core';
import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental';
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
import { ThemeSwitcherComponent } from './components/theme-switcher/theme-switcher.component';
import { LucideAngularModule } from 'lucide-angular';
import { ThemeSwitcherComponent } from './components/theme-switcher/theme-switcher.component';

@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, LucideAngularModule, ThemeSwitcherComponent, RouterLink, RouterLinkActive],
imports: [RouterOutlet, LucideAngularModule, ThemeSwitcherComponent, RouterLink, RouterLinkActive, AngularQueryDevtools],
templateUrl: './app.component.html',
styles: []
})
export class AppComponent {
title = 'Hephaestus';

isDevMode() {
return isDevMode();
}
}
2 changes: 0 additions & 2 deletions webapp/src/app/example/hello/hello.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@
}

<app-button class="p-2" (onClick)="addHello()"> Add Hello </app-button>

<angular-query-devtools initialIsOpen />
3 changes: 1 addition & 2 deletions webapp/src/app/example/hello/hello.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Component, inject } from '@angular/core';
import { injectMutation, injectQuery, injectQueryClient } from '@tanstack/angular-query-experimental';
import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental';
import { lastValueFrom } from 'rxjs';
import { HelloService } from 'app/core/modules/openapi';
import { ButtonComponent } from 'app/ui/button/button.component';

@Component({
selector: 'app-hello',
standalone: true,
imports: [ButtonComponent, AngularQueryDevtools],
imports: [ButtonComponent],
templateUrl: './hello.component.html'
})
export class HelloComponent {
Expand Down

0 comments on commit 4744440

Please sign in to comment.