Code Monkey home page Code Monkey logo

angular-challenges's Introduction

Collection of Angular challenges


Intro

This project has been created with three purposes:

  • The first purpose is to assist you in becoming better at Angular and its ecosystem. πŸ’ͺ
  • The second purpose is to share best practices and different implementations of the same problem to gain diverse perspectives. πŸ“–
  • The last one is to lower the barrier to open source contribution.

Sharing knowledge can benefit everyone.

Furthermore, if you are struggling with a concept, please open an issue. I will attempt to create a challenge based on that idea.

If you would like to propose a challenge, this project is open source, so feel free to share your ideas. They are more than welcome.

Learning by reading is good but learning by doing is better.

Challenges

Check all 49 challenges

Contributors ✨

Laforge Thomas
Laforge Thomas

🧩 πŸ’» πŸ“– πŸ–‹ πŸ€” 🎨 πŸ‡«πŸ‡·
Sven Brodny
Sven Brodny

πŸ“– 🧩 πŸ–‹ 🎨
J. Degand
J. Degand

πŸ“– πŸ–‹ πŸ’»
Devesh Chaudhari
Devesh Chaudhari

πŸ’» πŸ› 🧩
stillst
stillst

🧩 πŸ‡·πŸ‡Ί
Wandrille
Wandrille

🧩
Timothy Alcaide
Timothy Alcaide

🧩
Alan Dragicevich
Alan Dragicevich

πŸ“–
Michel EDIGHOFFER
Michel EDIGHOFFER

πŸ“–
Gerardo Sebastian Gonzalez
Gerardo Sebastian Gonzalez

πŸ“–
Evseev Yuriy
Evseev Yuriy

πŸ›
Tomer953
Tomer953

πŸ› πŸ“– πŸ’»
Dmitriy Mishchenko
Dmitriy Mishchenko

πŸ“–
Sagar Devkota
Sagar Devkota

πŸ“– πŸ’»
Nelson Gutierrez
Nelson Gutierrez

πŸ‡ͺπŸ‡Έ
Hossain K. M.
Hossain K. M.

πŸ“–
Diogo Nishikawa
Diogo Nishikawa

πŸ’» πŸ‡΅πŸ‡Ή πŸ“–
Erick Rodriguez
Erick Rodriguez

πŸ‡ͺπŸ‡Έ
Eduardo Roth
Eduardo Roth

πŸ“– πŸ‡ͺπŸ‡Έ
Fernando Bello
Fernando Bello

πŸ“–
Π›Π°ΠΏΠΈΠ½ АндрСй (Lapin Andrey)
Π›Π°ΠΏΠΈΠ½ АндрСй (Lapin Andrey)

πŸ‡·πŸ‡Ί
Dinar Shagaliev
Dinar Shagaliev

πŸ‡·πŸ‡Ί
Vimulatus
Vimulatus

πŸ“–
Add your contributions

Contributions of any kind are welcome.

If I have forgotten to add you as a contributor, please reach out to me. πŸ™

License

MIT

angular-challenges's People

Contributors

1fbr avatar alcaidio avatar aldrag avatar allcontributors[bot] avatar deveshchau avatar dinozavvvr avatar dmmishchenko avatar edimitchel avatar eduardoroth avatar erickrodrcodes avatar gsgonzalez88 avatar ho-ssain avatar jdegand avatar kabrunko-dev avatar marryday avatar nelsongutidev avatar pascalmh avatar sagardevkota avatar sbrodny avatar svenson95 avatar tomalaforge avatar tomer953 avatar vimulatus avatar wandri avatar webbomj avatar wuglyakbolgoink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-challenges's Issues

[Docs] New I18n language pt-BR

Hello, everybody! πŸ‘‹

I've been thinking if it's possible to add "pt-BR" (i.e. brazilian portuguese) as a new language for the I18n.

I'll be glad to help in the translation. Also, If someone wants to help, please let me know.

I'm suggesting this, because some friends at my work doesn't have a good grasp in English. Likewise, I would dare to say that more people who uses Angular could enjoy the challenges if it was in portuguese. So it would be nice to make these challenges available to more languages.

PS: Sorry for any language/grammar mistake πŸ™‹

Cheers!

Typo in getting started guide

I found a typo in docs/src/content/docs/guides/getting-started.md:

- ## Install all dependancies
+ ## Install all dependencies

Translation ES

  • Home Page (missing the sponsor box)

Guide

  • Check out Somebody's Answer
  • Contribute
  • Create your own challenge
  • FAQ
  • Getting Started
  • Rebase your branch
  • Resolve a Challenge

Angular

  • Projection (Missing the Bonus Challenges)
  • Directive Enhancement
  • Typed ContextOutlet
  • Crud application
  • Structural Directive
  • Pure Pipe
  • Wrap Function Pipe
  • Utility Wrapper Pipe
  • Highly Customizable CSS
  • Master Dependancy Injection
  • Anchor Navigation
  • @RouterInput()
  • Interoperability Rxjs/Signal
  • Module to Standalone
  • Change Detection Bug
  • Decoupling Components
  • InjectionToken
  • Signal Input
  • View Transition
  • React in Angular

Ngrx

  • Effect vs Selector
  • Power of Effect

NX

  • Extend Lib Generator
  • Component Generator
  • Custom Eslint Rule

Performance

  • Optimize Change Detection
  • Default vs OnPush
  • Memoization
  • NgFor Optimization
  • Optimize Big List
  • Web workers
  • Index

Testing

  • Router
  • Nested Components
  • Input Output
  • Modal
  • Harness
  • Harness Creation
  • Checkbox
  • Real Application
  • Index

Rxjs

  • High Order Operator Bug
  • Race Condition
  • catchError

Typescript

  • Function Overload

Signal Challenge Series

I think it's a good idea to discuss about new challenges in the first place. So I've created this "issue" here to talk about it. Hope that's fine.

Since we talked about signal challenges in my last challenge proposal, I've thought about a cool challenge user story. It might be a 3/4 parts series about signals, including the new input, output, viewChild syntax among other things. My idea would be to create a new section in the challenges (like angular, forms, performance, testing, ...) for signals. That could be a eyecatcher for devs who want to learn more about signals.

Here is our discussion from my last challenge proposal, if you want to look at it again. Feel free to give some feedback to the draft below.


Challenge 1: Signal Effect Bug | bug-effect-signal

  • Context: Bob πŸ§™β€β™‚οΈ want's to update the project to the newest version of angular, and take advantage of the new signal feature.
  • User Story:
    • Task 1: refactor a Observable to signal
    • Task 2: refactor @ViewChildren() with viewChild() (With a suitable example that highlights the advantages)

Challenge 2: Signal Basics

  • Context: Bob πŸ§™β€β™‚οΈ want's to update the project to the newest version of angular, and take advantage of the new signal feature.
  • User Story:
    • Task 1: refactor a Observable to signal
    • Task 2: refactor @ViewChildren() with viewChild() (With a suitable example that highlights the advantages)

Challenge 3: Computed function with a ternary inside

  • Context: You're working an application which has a light and dark theme. Bob πŸ§™β€β™‚οΈ want's a cleaner way to detect if dark mode is active.
  • User Story: refactor a function isDarkModeActive with a computed signal (computed function with a ternary inside)

Challenge 3: ...

Translation file skeleton (TO BE EDITED WHEN NEW CHALLENGE IS ADDED)

  • Home Page

Guide

  • Check out Somebody's Answer
  • Contribute
  • Create your own challenge
  • FAQ
  • Getting Started
  • Rebase your branch
  • Resolve a Challenge

Angular

  • Projection
  • Directive Enhancement
  • Typed ContextOutlet
  • Crud application
  • Structural Directive
  • Pure Pipe
  • Wrap Function Pipe
  • Utility Wrapper Pipe
  • Highly Customizable CSS
  • Master Dependancy Injection
  • Anchor Navigation
  • @RouterInput()
  • Interoperability Rxjs/Signal
  • Module to Standalone
  • Change Detection Bug
  • Decoupling Components
  • InjectionToken
  • Signal Input
  • View Transition
  • React in Angular

Form

  • Form control Value accessor

Ngrx

  • Effect vs Selector
  • Power of Effect

NX

  • Extend Lib Generator
  • Component Generator
  • Custom Eslint Rule

Performance

  • Optimize Change Detection
  • Default vs OnPush
  • Memoization
  • NgFor Optimization
  • Optimize Big List
  • Web workers
  • Index

Testing

  • Router
  • Nested Components
  • Input Output
  • Modal
  • Harness
  • Harness Creation
  • Checkbox
  • Real Application
  • Index

Rxjs

  • High Order Operator Bug
  • Race Condition
  • catchError

Typescript

  • Function Overload

(Challenge 1) Additions to project's code and challenge's doc

Hi, Thomas πŸ‘‹ How are you?

I've just finished the first challenge about Projection and I'd like to suggest some additions that I believe it would make a better experience for developers allowing them to focus in the projection side of the challenge.

These considerations are based on some common behaviours among some PRs that I saw during my challenge implementation.

πŸ–₯ Project's code

πŸ“– Challenge's documentation

  • Add a new source for understading or further reading about ngTemplateOutlet:
    (It's because the official documentations (either Angular.io or Angular.dev) doens't help very much as reading some tutorials or your article with the answer)
  • A section named "A Step Further" (something with this ideia) listing some minichallenges about using some new Angular features like the new control flow syntax (e.g. @if, @for, @empty) and signals for state management, since in some comment of yours, you recommend to use theses features.

What do you think?

Take care and have a nice day πŸ˜„

[Challenge Request] nested forms

A common task for any web developer is to build forms, some of them are more than just a simple β€œlogin” form.

Lets take an example of creating β€œCreate new Challenge” form, with 3 parts:

  • Basic info: name, description, difficulty
  • author details: name, age, socialUrl
  • references: array of useful urls

Now the aim of the challenge is to:

  1. Split the form logic into smaller components, while still be able to maintain the form state (valid \ etc)
  2. Maintain the form type, using strongly typed forms
  3. Be able to reuse the smaller components in different context, such as β€œedit address” dialog

I think strongly typed forms is a bit tricky when trying to split into components.
What do you think about the idea?

Translation RU

  • Home Page

Guide

  • Check out Somebody's Answer
  • Contribute
  • Create your own challenge
  • FAQ
  • Getting Started
  • Rebase your branch
  • Resolve a Challenge

Angular

  • Projection
  • Directive Enhancement
  • Typed ContextOutlet
  • Crud application
  • Structural Directive
  • Pure Pipe
  • Wrap Function Pipe
  • Utility Wrapper Pipe
  • Highly Customizable CSS
  • Master Dependancy Injection
  • Anchor Navigation
  • @RouterInput()
  • Interoperability Rxjs/Signal
  • Module to Standalone
  • Change Detection Bug
  • Decoupling Components
  • InjectionToken
  • Signal Input
  • View Transition
  • React in Angular
  • Animations

Form

  • Form control Value accessor

Ngrx

  • Effect vs Selector
  • Power of Effect

NX

  • Extend Lib Generator
  • Component Generator
  • Custom Eslint Rule

Performance

  • Optimize Change Detection
  • Default vs OnPush
  • Memoization
  • NgFor Optimization
  • Optimize Big List
  • Web workers
  • Index

Testing

  • Router
  • Nested Components
  • Input Output
  • Modal
  • Harness
  • Harness Creation
  • Checkbox
  • Real Application
  • Index

Rxjs

  • High Order Operator Bug
  • Race Condition
  • catchError

Typescript

  • Function Overload

giscus dark mode

I'm starting a new issue, this will be easier to follow.

From @jdegand
I think the dark mode problems may stem from the binding of the theme. See this giscus issue. On my computer the comment section is still white on the dark mode as well. You are binding in the comment section.astro file with data-theme="preferred_color_scheme". I noticed inspecting source code both light and dark in some classes.

Giscus doesn't really seem to support / advertise Angular support (Giscus component has no version for Angular) and I think the binding issue is probably why.

It is just a minor issue.

Originally posted by @jdegand in #377 (comment)

Translation es-MX

  • Home Page

Guide

  • Check out Somebody's Answer
  • Contribute
  • Create your own challenge
  • FAQ
  • Getting Started
  • Rebase your branch
  • Resolve a Challenge

Angular

  • Projection
  • Directive Enhancement
  • Typed ContextOutlet
  • Crud application
  • Structural Directive
  • Pure Pipe
  • Wrap Function Pipe
  • Utility Wrapper Pipe
  • Highly Customizable CSS
  • Master Dependancy Injection
  • Anchor Navigation
  • @RouterInput()
  • Interoperability Rxjs/Signal
  • Module to Standalone
  • Change Detection Bug
  • Decoupling Components
  • InjectionToken

Ngrx

  • Effect vs Selector
  • Power of Effect

NX

  • Extend Lib Generator
  • Component Generator
  • Custom Eslint Rule

Performance

  • Optimize Change Detection
  • Default vs OnPush
  • Memoization
  • NgFor Optimization
  • Optimize Big List
  • Web workers
  • Index

Testing

  • Router
  • Nested Components
  • Input Output
  • Modal
  • Harness
  • Harness Creation
  • Checkbox
  • Real Application
  • Index

Rxjs

  • High Order Operator Bug
  • Race Condition
  • catchError

Typescript

  • Function Overload

NgRx Notification directions need clarification

create an injection token to hide the push service implementation. -> Couldn't you just remove the notifications service completely and inject the push service and recreate the init method in each store ? i.e. When we navigate to any route, the init method will dispatch an event and a new student etc will be added to the list. This does work but the notifications will continue when you navigate away from that route. Notifications for each route should be displayed only when the user is on that route.

Option 1: set SchoolStore in root, but we don't want this to separate our class. -> This is unclear.
You can't listen to an action to trigger an effect with the SchoolStore because the SchoolStore uses Component Store. A Component Store has no actions. So even if it is set in root, I don't see how that would work.

I used a global effect for a snackbar alert and added a student effect like this

  addStudent$ = createEffect(() =>
    this.actions$.pipe(
      ofType(studentActions.addOneStudent),
      map(action =>
        appActions.showAlert({
          message: "Add 1 Student"
        })
      )
    )
  ); 

This causes a snackbar alert with the message.

I could rewrite the school store to mimic the other stores but that is not the intended fix.

 // from school.store

  private readonly loadSchools = this.effect<void>(
    pipe(
      switchMap(() =>
        this.httpService.getAllSchools().pipe(
          tapResponse(
            (schools) => this.patchState({ schools }),
            (_) => _  //  This confused me initially.  Best to add a comment that you don't have to implement error handling ? 
          )
        )
      )
    )
  );

The directions could use a mention of Angular Material snackbar since Angular Material is an included dependency.

Translation PT

  • Home Page

Guide

  • Check out Somebody's Answer
  • Contribute
  • Create your own challenge
  • FAQ
  • Getting Started
  • Rebase your branch
  • Resolve a Challenge

Angular

  • Projection
  • Directive Enhancement
  • Typed ContextOutlet
  • Crud application
  • Structural Directive
  • Pure Pipe
  • Wrap Function Pipe
  • Utility Wrapper Pipe
  • Highly Customizable CSS
  • Master Dependancy Injection
  • Anchor Navigation
  • @RouterInput()
  • Interoperability Rxjs/Signal
  • Module to Standalone
  • Change Detection Bug
  • Decoupling Components
  • InjectionToken
  • Signal Input
  • View Transition
  • React in Angular
  • Simple Animation

Ngrx

  • Effect vs Selector
  • Power of Effect

NX

  • Extend Lib Generator
  • Component Generator
  • Custom Eslint Rule

Performance

  • Optimize Change Detection
  • Default vs OnPush
  • Memoization
  • NgFor Optimization
  • Optimize Big List
  • Web workers
  • Index

Testing

  • Router
  • Nested Components
  • Input Output
  • Modal
  • Harness
  • Harness Creation
  • Checkbox
  • Real Application
  • Index

Rxjs

  • High Order Operator Bug
  • Race Condition
  • catchError

Typescript

  • Function Overload

challenge 11: typo in doc and config error in

Hi ,

  • There is typo in doc, please update this typo from npx nx serve rxjs-pipe-bu to npx nx serve rxjs-pipe-bug.
  • I am also facing error when running this command NX Could not find any runner configurations in nx.json.
    I have restarted the vs code and run the serve command again. Now i am getting different error: NX Cannot read properties of undefined (reading 'default').

doc url: https://angular-challenges.vercel.app/challenges/rxjs/11-bug-chaining-operator/

The constraints of the "Projection" challenge lack clarity in their objective.

Link to challenge:

🟒 Projection

Description

Constraints section includes such point, maybe we should change it to ListItemComponent?

The NgFor directive must be declared and remain inside the CardComponent. You might be tempted to move it to the
CardComponent but avoid doing so.

Expected result

The NgFor directive must be declared and remain inside the CardComponent. You might be tempted to move it to the
ListItemComponent but avoid doing so.

Update Dependencies

  • Need to update Cypress to >= 13.5 for Angular 17 syntax.

  • Testing Library probably could also be updated.

  • @ngrx packages need updates

Help to start challenges

I follow the steps in site, but i cant start up a single challenge.
I run npm ci
i installed nx with global scope
i tried run npx nx serve angular-permissions --verbose

and i got this error:

image

I'm using nvm....and tried with ?
v16.12.0
v18.19.0

can anyone help me ?

Unify Spanish translations

So, we have 3 native Spanish speakers, and we didn't decide the right localization

When I started to do my part of translations, I didn't consider if it should be:

  • Iberican Spanish (es-ES)
  • or Latin-American Spanish (es-LA)
  • and now Mexican Spanish (es-MX)

The funny part: all of the Spanish translators (@ErickRodrCodes, @eduardoRoth and @nelsongutidev ) are Latin-American folks :)

The constrains between ex-MX and es-LA overlaps each other. My suggestion is to use ES without no localization, and here is why: we are talking to our community in technical language that is common. the context of the exercises remains intact because the language is very standard, and we don't talk about local lexical context. Example: We know we have to have a "git fork" to contribute, but when we translate back to Spanish, there is no way we say "git tenedor" because it is technical language.

I read through all the exercises and in my opinion, there is few rooms for specific lexical variation given the kind of language we intend to provide. So, it is better we just leave ES instead breaking up on multiple Spanish localizations.

cc @tomalaforge

Repo size

The size of the repo has doubled in the past few months. I'd suggest you remove rx-angular from dependencies. Unless you have an rx-angular challenge in progess, I'd remove it. rx-angular has 4,000 npm downloads a week. Niche dependencies like @ngrx/signals (7,000 a week) can added per PR. If you remove rx-angular etc, previous PR could break so you'd have to add a warning to the docs when checking out a PR with rx-angular or any removed dependency.

i18n for shared custom components

There is some shared component used in every page, but we need to use a key for i18n instead of a default english phrase.

The goal of this issue is to prepare the work by creating keys that can be translated afterwards.

Translation FR

  • Home Page

Guide

  • Check out Somebody's Answer
  • Contribute
  • Create your own challenge
  • FAQ
  • Getting Started
  • Rebase your branch
  • Resolve a Challenge

Angular

  • Projection
  • Directive Enhancement
  • Typed ContextOutlet
  • Crud application
  • Structural Directive
  • Pure Pipe
  • Wrap Function Pipe
  • Utility Wrapper Pipe
  • Highly Customizable CSS
  • Master Dependancy Injection
  • Anchor Navigation
  • @RouterInput()
  • Interoperability Rxjs/Signal
  • Module to Standalone
  • Change Detection Bug
  • Decoupling Components
  • InjectionToken
  • Signal Input
  • View Transition
  • React in Angular

Ngrx

  • Effect vs Selector
  • Power of Effect

NX

  • Extend Lib Generator
  • Component Generator
  • Custom Eslint Rule

Performance

  • Optimize Change Detection
  • Default vs OnPush
  • Memoization
  • NgFor Optimization
  • Optimize Big List
  • Web workers
  • Index

Testing

  • Router
  • Nested Components
  • Input Output
  • Modal
  • Harness
  • Harness Creation
  • Checkbox
  • Real Application
  • Index

Rxjs

  • High Order Operator Bug
  • Race Condition
  • catchError

Typescript

  • Function Overload

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.