-
Notifications
You must be signed in to change notification settings - Fork 160
Fix dxi component template rerendering issues #560
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
Changes from 5 commits
2c99781
8834b36
0a6beaf
4ccf060
9fce9d1
6c3dd3a
26860e3
a41d6d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { DxComponent } from './component'; | ||
import { DxTemplateDirective } from './template'; | ||
|
||
export interface IDxTemplateHost { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. There are good points why we should use the I prefix :) |
||
setTemplate(template: DxTemplateDirective); | ||
}; | ||
|
||
export class DxTemplateHost { | ||
host: DxComponent; | ||
setHost(host: DxComponent) { | ||
host: IDxTemplateHost; | ||
setHost(host: IDxTemplateHost) { | ||
this.host = host; | ||
} | ||
setTemplate(template: DxTemplateDirective) { | ||
|
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:
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)".