-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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(ivy): error if directive with synthetic property binding is on same node as directive that injects ViewContainerRef #35343
Conversation
…me node as directive that injects ViewContainerRef In the `loadRenderer` we make an assumption that the value will always be an `LView`, but if there's a directive on the same node which injects `ViewContainerRef` the `LView` will be wrapped in an `LContainer`. These changes add a call to unwrap the value before we try to read the value off of it. Fixes angular#35342.
expect(() => { | ||
const fixture = TestBed.createComponent(App); | ||
fixture.detectChanges(); | ||
}).not.toThrow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that you need explicit not.toThrow();
a test would fail in case of an exception thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer this as it makes it very clear what you are testing. Without this it is harder to understand what exactly you are testing. I think of it as a marker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I hear what you say about marker and this is a good point. The problem I've got with such assertion, though, is that this test is going to pass even if nothing happens / gets rendered. I could pretty much delete the entire template and the test would still pass.
This is why, personally, I prefer to have a more concrete assert... Definitively don't want to split a hair over this one, just sharing personal preference / how I think about it...
…me node as directive that injects ViewContainerRef (#35343) In the `loadRenderer` we make an assumption that the value will always be an `LView`, but if there's a directive on the same node which injects `ViewContainerRef` the `LView` will be wrapped in an `LContainer`. These changes add a call to unwrap the value before we try to read the value off of it. Fixes #35342. PR Close #35343
…me node as directive that injects ViewContainerRef (angular#35343) In the `loadRenderer` we make an assumption that the value will always be an `LView`, but if there's a directive on the same node which injects `ViewContainerRef` the `LView` will be wrapped in an `LContainer`. These changes add a call to unwrap the value before we try to read the value off of it. Fixes angular#35342. PR Close angular#35343
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
In the
loadRenderer
we make an assumption that the value will always be anLView
, but if there's a directive on the same node which injectsViewContainerRef
theLView
will be wrapped in anLContainer
. These changes add a call to unwrap the value before we try to read the value off of it.Fixes #35342.