Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: many grammar tweaks #957

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contributors:
- tomalaforge
- tomer953
- svenson95
- LMFinney
challengeNumber: 10
command: angular-utility-wrapper-pipe
sidebar:
Expand All @@ -14,13 +15,13 @@ sidebar:

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want you can add your github handle in all files you fixed. if you want to.

thanks a lot 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a new commit.

I also rebased.

## Information

This is the third of three `@Pipe()` challenges, the goal of this series is to master **pipes** in Angular.
This is the third of three `@Pipe()` challenges. The goal of this series is to master **pipes** in Angular.

Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So, they won't be recalculated every change detection cycle if their inputs haven't changed.

Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improving rendering performance.
Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improve rendering performance.

By default a pipe is pure, you should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.
By default, a pipe is pure. You should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.

:::note
A **pure** pipe is only called when the value changes.\
Expand All @@ -31,7 +32,7 @@ There are some useful predefined pipes like the DatePipe, UpperCasePipe and Curr

## Statement

In this exercise, you want to access utils functions. Currently you cannot access them directly from your template. The goal is to create a specific pipe for this utils file, where you will need to pass the name of the function you want to call and the needed arguments.
In this exercise, you want to access utils functions. Currently, you cannot access them directly from your template. The goal is to create a specific pipe for this utils file, where you will need to pass the name of the function you want to call and the needed arguments.

## Constraints

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contributors:
- tomalaforge
- tomer953
- kabrunko-dev
- LMFinney
challengeNumber: 13
command: angular-highly-customizable-css
sidebar:
Expand All @@ -14,7 +15,7 @@ sidebar:

## Information

Styling is an important aspect of a frontend developer's day job, but it is often underestimated. In Angular applications, I frequently see people using `@Input()` to customize the style of their components. However, `@Input()` should only be used for logic. Other techniques, such as **CSS variables** and **host-context** should be used for styling.
Styling is an important aspect of a frontend developer's day job, but it is often underestimated. In Angular applications, I frequently see people using `@Input()` to customize the style of their components. However, `@Input()` should only be used for logic. Other techniques, such as **CSS variables** and **host-context**, should be used for styling.

In this challenge, you will need to use both CSS variables and `:host-context` to remove all `@Input()` from your code.

Expand Down
3 changes: 2 additions & 1 deletion docs/src/content/docs/challenges/angular/22-router-input.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: 🟢 @RouterInput()
description: Challenge 22 is about using the @Input decorator to retreive router params.
description: Challenge 22 is about using the @Input decorator to retrieve router params.
author: thomas-laforge
contributors:
- tomalaforge
- tomer953
- svenson95
- LMFinney
challengeNumber: 22
command: angular-router-input
blogLink: https://medium.com/ngconf/accessing-route-params-in-angular-1f8e12770617
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contributors:
- tomer953
- kabrunko-dev
- svenson95
- LMFinney
challengeNumber: 3
command: angular-directive-enhancement
blogLink: https://medium.com/@thomas.laforge/ngfor-enhancement-716b44656a6c
Expand All @@ -20,15 +21,15 @@ This exercise can feel obsolete with the new control flow and the empty block in

## Information

Directive is a very powerful tool only offered by the Angular framework. You can apply the DRY principle by having shared logic inside a directive and applying it to any component you want.
Directives are a very powerful tool only offered by the Angular framework. You can apply the DRY principle by having shared logic inside a directive and applying it to any component you want.

But the real power is that you can enhance an already existing directive which moreover doesn't **belong** to you.
But the real power is that you can enhance an already-existing directive, which moreover doesn't **belong** to you.

## Statement

In this exercise, we have a want to display a list of persons. If the list is empty, you must display _" the list is empty !! "_.

Currently we have:
Currently, we have:

```typescript
<ng-container *ngIf="persons.length > 0; else emptyList">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contributors:
- tomalaforge
- tomer953
- jdegand
- LMFinney
challengeNumber: 32
command: angular-change-detection-bug
blogLink: https://medium.com/ngconf/function-calls-inside-template-are-dangerous-15f9822a6629
Expand All @@ -19,7 +20,7 @@ This challenge is inspired by a real-life example that I simplified to create th

## Information

In this small application, we have a navigation menu to route our application to either `BarComponent` or `FooComponent`. However our application is not loading and no errors are displayed inside the console.
In this small application, we have a navigation menu to route our application to either `BarComponent` or `FooComponent`. However, our application is not loading and no errors are displayed inside the console.

## Statement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ author: thomas-laforge
contributors:
- tomalaforge
- jdegand
- LMFinney
challengeNumber: 33
command: angular-decoupling-components
sidebar:
Expand All @@ -18,9 +19,9 @@ sidebar:

The goal of this challenge is to separate the behavior of a component from its style. For the purpose of this challenge, we will be working on a button element. When we click on it, we will toggle a _disabled_ property which will change the style of the element. This is quite useless in real life but the challenge aims to demonstrate a useful concept.

The behavior of the component (referred to as the _brain_ in the Spartan stack) is located in the brain library. The styling part (referred to as the _helmet_) is located inside the helmet library. Both libraries cannot depend on each other because we want to be able to publish them separately. To help us address the issue, we are using the Nx enforce eslint rule. You can find more details [here](https://nx.dev/core-features/enforce-module-boundaries).
The behavior of the component (referred to as the _brain_ in the Spartan stack) is located in the brain library. The styling part (referred to as the _helmet_) is located inside the helmet library. Both libraries cannot depend on each other because we want to be able to publish them separately. To help us address the issue, we are using the Nx `enforce-module-boundaries` eslint rule. You can find more details [here](https://nx.dev/core-features/enforce-module-boundaries).

However the button's helmet needs to access the state of the component to style the button differently based on its state. As mention above, we cannot import the `BtnDisabledDirective` directly into the helmet library as done currently. If you go to [`BtnHelmetDirective`](../../libs/decoupling/helmet/src/lib/btn-style.directive.ts), you will encounter a linting error. **A project tagged with `type:hlm` can only depend on libs tagged with `type:core`**.
However, the button's helmet needs to access the state of the component to style the button differently based on its state. As mentioned above, we cannot import the `BtnDisabledDirective` directly into the helmet library as done currently. If you go to [`BtnHelmetDirective`](../../libs/decoupling/helmet/src/lib/btn-style.directive.ts), you will encounter a linting error. **A project tagged with `type:hlm` can only depend on libs tagged with `type:core`**.

## Statement

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: 🟠 InjectionToken
description: Challenge 39 is about learning the power of dependancy injection
description: Challenge 39 is about learning the power of dependency injection
author: thomas-laforge
contributors:
- tomalaforge
- jdegand
- LMFinney
challengeNumber: 39
command: angular-injection-token
sidebar:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contributors:
- tomer953
- svenson95
- jdegand
- LMFinney
challengeNumber: 4
command: angular-typed-context-outlet
blogLink: https://medium.com/@thomas.laforge/ngtemplateoutlet-type-checking-5d2dcb07a2c6
Expand All @@ -18,7 +19,7 @@ sidebar:

You can improve template type checking for custom directives by adding template guard properties to your directive definition. Angular offers the static function [`ngTemplateContextGuard`](https://angular.dev/guide/directives/structural-directives#improving-template-type-checking-for-custom-directives) to strongly type structural directives.

However the context of **NgTemplateOutlet** type is **Object**. But with the help of the above guard, we can improve that behavior.
However, the context of **NgTemplateOutlet** type is **Object**. But with the help of the above guard, we can improve that behavior.

## Statement

Expand All @@ -28,17 +29,17 @@ This exercise has two levels of complexity.

### Level 1: Known Interface

Currently we have the following piece of code.
Currently, we have the following piece of code.

![Unkown Person](../../../../assets/4/unknown-person.png 'Unkown Person')
![Unknown Person](../../../../assets/4/unknown-person.png 'Unknown Person')

As we can see, `name` is of type `any`. We want to infer the correct type using the custom directive `PersonDirective`.

### Level 2: Generic Interface

Currently we have the following piece of code.
Currently, we have the following piece of code.

![Unkown Student](../../../../assets/4/unknown-student.png 'Unkown Student')
![Unknown Student](../../../../assets/4/unknown-student.png 'Unknown Student')

As we can see, `student` is of type `any`. We want to infer the correct type using the custom directive `ListDirective`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ author: thomas-laforge
contributors:
- tomalaforge
- jdegand
- LMFinney
challengeNumber: 44
command: angular-view-transition
sidebar:
Expand All @@ -13,9 +14,9 @@ sidebar:

## Information

This is the second of two animation challenges, the goal of this series is to master animations in Angular.
This is the second of two animation challenges. The goal of this series is to master animations in Angular.

The View Transition API is a brand new API that provides a set of features that allow developers to control and manipulate the transitions and animations between views within an application.
The View Transition API is a brand-new API that provides a set of features that allow developers to control and manipulate the transitions and animations between views within an application.
It plays a pivotal role in enhancing the user experience (UX), bringing applications to life with engaging and captivating transitions to guide users through different pages or sections of the app.

The goal of this challenge is to learn about and manipulate all types of transitions proposed by the API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contributors:
- wandri
- tomalaforge
- jdegand
- LMFinney
challengeNumber: 45
command: angular-react-in-angular
sidebar:
Expand Down Expand Up @@ -57,7 +58,7 @@ npm i --save-dev @types/react @types/react-dom

<details>
<summary>Hint 2 - Initialization</summary>
Create a react root with `createRoot(...)`
Create a React root with `createRoot(...)`
</details>

<details>
Expand All @@ -76,5 +77,5 @@ npm i --save-dev @types/react @types/react-dom

<details>
<summary>Hint 4 - Design</summary>
Do not forget to allow the react file in Tailwind.
Do not forget to allow the React file in Tailwind.
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Challenge 46 is about learning Angular's integrated animation API
author: sven-brodny
contributors:
- svenson95
- LMFinney
challengeNumber: 46
command: angular-simple-animations
sidebar:
Expand All @@ -12,7 +13,7 @@ sidebar:

## Information

This is the first of two animation challenges, the goal of this series is to master animations in Angular.
This is the first of two animation challenges. The goal of this series is to master animations in Angular.

Well-designed animations can make your application more fun and straightforward to use, but they aren't just cosmetic. Animations can improve your application and user experience in a number of ways:

Expand All @@ -22,7 +23,7 @@ Well-designed animations can make your application more fun and straightforward

I would recommend you read the [official documentation](https://angular.dev/guide/animations). You will learn everything that is necessary to successfully complete the challenge.

Otherwise look at this [working example](https://svenson95.github.io/ng-xmp-animations/) and [git repo](https://github.com/svenson95/ng-xmp-animations) to get inspired.
Otherwise, look at this [working example](https://svenson95.github.io/ng-xmp-animations/) and [git repo](https://github.com/svenson95/ng-xmp-animations) to get inspired.

## Statement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contributors:
- tomer953
- svenson95
- jdegand
- LMFinney
challengeNumber: 5
command: angular-crud-application
sidebar:
Expand All @@ -21,7 +22,7 @@ Communicating and having a global/local state in sync with your backend is the h

In this exercise, you have a small CRUD application, which get a list of TODOS, update and delete some todos.

Currently we have a working example but filled with lots of bad practices.
Currently, we have a working example but filled with lots of bad practices.

### Step 1: refactor with best practices

Expand Down
21 changes: 0 additions & 21 deletions docs/src/content/docs/challenges/angular/50-bug-effect-signal.md

This file was deleted.

9 changes: 5 additions & 4 deletions docs/src/content/docs/challenges/angular/8-pure-pipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contributors:
- tomer953
- kabrunko-dev
- svenson95
- LMFinney
challengeNumber: 8
command: angular-pure-pipe
blogLink: https://medium.com/ngconf/deep-dive-into-angular-pipes-c040588cd15d
Expand All @@ -16,13 +17,13 @@ sidebar:

## Information

This is the first of three `@Pipe()` challenges, the goal of this series is to master **pipes** in Angular.
This is the first of three `@Pipe()` challenges. The goal of this series is to master **pipes** in Angular.

Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So, they won't be recalculated every change detection cycle if their inputs haven't changed.

Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improving rendering performance.
Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improve rendering performance.

By default a pipe is pure, you should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.
By default, a pipe is pure. You should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.

:::note
A **pure** pipe is only called when the value changes.\
Expand Down
15 changes: 8 additions & 7 deletions docs/src/content/docs/challenges/angular/9-wrap-function-pipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contributors:
- tomer953
- kabrunko-dev
- svenson95
- LMFinney
challengeNumber: 9
command: angular-wrap-function-pipe
blogLink: https://medium.com/ngconf/boost-your-apps-performance-by-wrapping-your-functions-inside-a-pipe-7e889a901d1d
Expand All @@ -16,26 +17,26 @@ sidebar:

## Information

This is the second of three `@Pipe()` challenges, the goal of this series is to master **pipes** in Angular.
This is the second of three `@Pipe()` challenges. The goal of this series is to master **pipes** in Angular.

Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So, they won't be recalculated every change detection cycle if their inputs haven't changed.

Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improving rendering performance.
Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improve rendering performance.

By default a pipe is pure, you should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.
By default, a pipe is pure. You should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.

:::note
A **pure** pipe is only called when the value changes.\
A **impure** pipe is called every change detection cycle.
:::

There are some useful predefined pipes like the DatePipe, UpperCasePipe and CurrencyPipe. To learn more about pipes in Angular, check the API documentation [here]https://angular.dev/guide/pipes).
There are some useful predefined pipes like the DatePipe, UpperCasePipe and CurrencyPipe. To learn more about pipes in Angular, check the API documentation [here](https://angular.dev/guide/pipes).

## Statement

In this exercise, you are calling multiple functions inside your template. You can create a specific pipe for each of the functions but this will be too cumbersome.
In this exercise, you are calling multiple functions inside your template. You can create a specific pipe for each of the functions, but this will be too cumbersome.
The goal is to create a `wrapFn` pipe to wrap your callback function through a pipe. Your function MUST remain inside your component. **`WrapFn` must be highly reusable.**

## Constraints:
## Constraints

- Must be strongly typed
Loading