From da4d14123933a37e65dd8b803a6882270dc0d75b Mon Sep 17 00:00:00 2001 From: "J. Degand" <70610011+jdegand@users.noreply.github.com> Date: Wed, 31 Jul 2024 05:08:33 -0400 Subject: [PATCH] docs: add pipe precedence content angular (#6292) --- .../pipes-precedence@nZxZnzbQg9dz-SI65UHq9.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/angular/content/pipes-precedence@nZxZnzbQg9dz-SI65UHq9.md b/src/data/roadmaps/angular/content/pipes-precedence@nZxZnzbQg9dz-SI65UHq9.md index 63f9a2f74..6e57a872d 100644 --- a/src/data/roadmaps/angular/content/pipes-precedence@nZxZnzbQg9dz-SI65UHq9.md +++ b/src/data/roadmaps/angular/content/pipes-precedence@nZxZnzbQg9dz-SI65UHq9.md @@ -1 +1,14 @@ -# Pipes Precedence \ No newline at end of file +# Pipes Precedence + +The pipe operator has a higher precedence than the JavaScript ternary operator. + +You should always use parentheses to be sure Angular evaluates the expression as you intend. + +``` +(condition ? a : b) | pipe +``` + +Visit the following resources to learn more: + +- [@article@Precedence](https://angular.dev/guide/pipes/precedence) +- [@article@What is the precedence between pipe and ternary operators?](https://iq.js.org/questions/angular/what-is-the-precedence-between-pipe-and-ternary-operators)