Skip to content

Commit

Permalink
docs: update the syntax highlighting for angular (#7762)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgechev committed Jul 19, 2024
1 parent b189e31 commit 2786196
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/framework/angular/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Floating Mode will mount the devtools as a fixed, floating element in your app a

Place the following code as high in your Angular app as you can. The closer it is to the root of the page, the better it will work!

```ts
```angular-ts
import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental'
import { Component } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ref: docs/framework/react/guides/background-fetching-indicators.md

[//]: # 'Example'

```ts
```angular-ts
@Component({
selector: 'posts',
template: `
Expand Down Expand Up @@ -39,7 +39,7 @@ export class TodosComponent {
[//]: # 'Example'
[//]: # 'Example2'

```ts
```angular-ts
import { injectIsFetching } from '@tanstack/angular-query-experimental'
@Component({
Expand Down
6 changes: 3 additions & 3 deletions docs/framework/angular/guides/disabling-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replace: { 'useQuery': 'injectQuery' }

[//]: # 'Example'

```ts
```angular-ts
@Component({
selector: 'todos',
template: `<div>
Expand Down Expand Up @@ -44,7 +44,7 @@ export class TodosComponent {
[//]: # 'Example'
[//]: # 'Example2'

```ts
```angular-ts
@Component({
selector: 'todos',
template: `
Expand All @@ -69,7 +69,7 @@ export class TodosComponent {
[//]: # 'Example2'
[//]: # 'Example3'

```ts
```angular-ts
@Component({
selector: 'todos',
template: `
Expand Down
6 changes: 3 additions & 3 deletions docs/framework/angular/guides/infinite-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replace:

[//]: # 'Example'

```ts
```angular-ts
import { Component, computed, inject } from '@angular/core'
import { injectInfiniteQuery } from '@tanstack/angular-query-experimental'
import { lastValueFrom } from 'rxjs'
Expand Down Expand Up @@ -48,7 +48,7 @@ export class Example {
}
```

```html
```angular-html
<div>
@if (query.isPending()) {
<p>Loading...</p>
Expand All @@ -70,7 +70,7 @@ export class Example {
[//]: # 'Example'
[//]: # 'Example1'

```ts
```angular-ts
@Component({
template: ` <list-component (endReached)="fetchNextPage()" /> `,
})
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/angular/guides/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ replace:

[//]: # 'Example'

```ts
```angular-ts
@Component({
template: `
<div>
Expand Down Expand Up @@ -45,7 +45,7 @@ export class TodosComponent {
[//]: # 'Example2'
[//]: # 'Example3'

```ts
```angular-ts
@Component({
standalone: true,
selector: 'todo-item',
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/angular/guides/optimistic-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ addTodo = injectMutation(() => ({
[//]: # 'ExampleUI1'
[//]: # 'ExampleUI2'

```ts
```angular-ts
@Component({
template: `
@for (todo of todos.data(); track todo.id) {
Expand All @@ -45,7 +45,7 @@ class TodosComponent {}
[//]: # 'ExampleUI2'
[//]: # 'ExampleUI3'

```ts
```angular-ts
@Component({
template: `
@if (addTodo.isError()) {
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/angular/guides/paginated-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const result = injectQuery(() => ({
[//]: # 'Example'
[//]: # 'Example2'

```ts
```angular-ts
@Component({
selector: 'pagination-example',
template: `
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/angular/guides/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ result = injectQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodoList }))
[//]: # 'Example2'
[//]: # 'Example3'

```ts
```angular-ts
@Component({
selector: 'todos',
standalone: true,
Expand Down Expand Up @@ -66,7 +66,7 @@ If booleans aren't your thing, you can always use the `status` state as well:

[//]: # 'Example4'

```ts
```angular-ts
@Component({
selector: 'todos',
standalone: true,
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/angular/guides/query-cancellation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ You might want to cancel a query manually. For example, if the request takes a l

[//]: # 'Example7'

```ts
```angular-ts
@Component({
standalone: true,
template: `<button (click)="onCancel()">Cancel</button>`,
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/angular/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ In the example below, you can see Angular Query in its most basic and simple for

[Open in CodeSandbox](https://codesandbox.io/s/github/tanstack/query/tree/main/examples/angular/simple)

```ts
```angular-ts
import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental'
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
import { HttpClient } from '@angular/common/http'
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/angular/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class AppModule {}

### Component with query and mutation

```ts
```angular-ts
import { Component, Injectable, inject } from '@angular/core'
import { HttpClient } from '@angular/common/http'
import { lastValueFrom } from 'rxjs'
Expand Down

0 comments on commit 2786196

Please sign in to comment.