-
Notifications
You must be signed in to change notification settings - Fork 159
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 dxi component template rerendering issues #560
Conversation
import { DxTemplateDirective } from './template'; | ||
|
||
export interface IDxTemplateHost { |
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.
We don't use I
prefix for interfaces
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.
5 of 7 existing interfaces have I prefix and just 2 don't. I would add it to the rest two.
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.
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.
There are good points why we should use the I prefix :)
README.md
Outdated
@@ -457,6 +457,28 @@ export class AppComponent { | |||
} | |||
``` | |||
|
|||
Note, in some scenarios an item content can be rerendered by it's host component. To keep the item child components alive they should be declared as a single template via the `dxTemplate` structural directive. There are several alternatives depending on the item content: |
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.
How can I find out is my scenario suited a described one?
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.
Good question. One way is if something works unexpectedly. Would you deprecate the approach without using dxTemplate in dxi-* components? Or any other thoughts?
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.
So, the workflow:
- write code
- check that it works correctly in all cases (if it embedded in another component and so on)
- if something went wrong - add dxTemplate and check again
It's a weird solution. It will be better to mark dxi- components without dxTemplate as deprecated and buggy in order to suppress support traffic.
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.
It appears that simple transclusion is much faster than using templates. So I'm afraid we shouldn't deprecate this approach. A clear condition for using templates is "you item content has any nested components (not just static markup)".
No description provided.