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

feat(component): add error as value to LetDirective's context #3380

Merged

Conversation

markostanimirovic
Copy link
Member

@markostanimirovic markostanimirovic commented Apr 14, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

The $error property from LetDirective's view context will be true or false.

Closes #3343

What is the new behavior?

The $error property from LetDirective's view context will be thrown error or undefined.

Does this PR introduce a breaking change?

[x] Yes
[ ] No

BREAKING CHANGES:

The `$error` property from `LetDirective`'s view context is a thrown error or `undefined` instead of `true`/`false`.

BEFORE:

<p *ngrxLet="obs$; $error as e">{{ e }}</p>

- `e` will be `true` when `obs$` emits error event.
- `e` will be `false` when `obs$` emits next/complete event.

AFTER:

<p *ngrxLet="obs$; $error as e">{{ e }}</p>

- `e` will be thrown error when `obs$` emits error event.
- `e` will be `undefined` when `obs$` emits next/complete event.

@netlify
Copy link

netlify bot commented Apr 14, 2022

Deploy Preview for ngrx-io ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 75b60a7
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/6258a6a19fa0620009391528
😎 Deploy Preview https://deploy-preview-3380--ngrx-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

BREAKING CHANGES:

The `$error` property from `LetDirective`'s view context is
a thrown error or `undefined` instead of `true`/`false`.

BEFORE:

```ts
<p *ngrxLet="obs$; $error as e">{{ e }}</p>
```

- `e` will be `true` when `obs$` emits error event.
- `e` will be `false` when `obs$` emits next/complete event.

AFTER:

```ts
<p *ngrxLet="obs$; $error as e">{{ e }}</p>
```

- `e` will be thrown error when `obs$` emits error event.
- `e` will be `undefined` when `obs$` emits next/complete event.
@brandonroberts brandonroberts merged commit 6452e24 into ngrx:master May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@ngrx/component: Add the $error as a value to the LetDirective's context
3 participants