You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm submitting a ... (check one with "x")
I've seen similar issues but OP is either misusing, or abandons post and it gets closed.
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior @HostBinding throws errors for properties that are clearly on DatatableComponent
Expected behavior @HostBinding('rows') rows = ... would pass rows into DatatableComponent
What is the motivation / use case for changing the behavior?
Allowing defaults to be set or custom loaders to be added to a ngx-datatable via directive instead of having to wrap it in another component. In my case, my external paging/sorting is handled the exact same way across the application.
Please tell us about your environment:
Windows 7, VSCode, yarn/npm, undertow/tomcat
Table version: 0.7.x
current, see plunkr
Angular version: 2.0.x
current, see plunkr
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome
To my knowledge this concerns Angular's compiler and is not unique to this library. The reason ngx-datatable doesn't have that property is because it is referring to ngx-datatable the DOM element, not the component. If you want that behavior then you need to submit a request on the Angular repo.
You don't need HostBinding to set defaults on components using directives. Angular will inject a reference to the DatatableComponent in your constructor (which you obviously included in your plunker.)
Why do you want to try and use directives to set the values of input properties when you can just do this in your directive?:
constructor(public datatable: DatatableComponent) {
}
@Input() customData; // an object containing relevant properties like rowHeight, footerHeight, limit, etc
ngOnChanges(changes) {
if ('customData' in changes) {
Object.assign(this.datatable, this.customData);
}
}
I'm submitting a ... (check one with "x")
I've seen similar issues but OP is either misusing, or abandons post and it gets closed.
Current behavior
@HostBinding throws errors for properties that are clearly on DatatableComponent
Expected behavior
@HostBinding('rows') rows = ... would pass rows into DatatableComponent
Reproduction of the problem
https://plnkr.co/edit/3Un9JvZIqLQ9KL1ETmuM
What is the motivation / use case for changing the behavior?
Allowing defaults to be set or custom loaders to be added to a ngx-datatable via directive instead of having to wrap it in another component. In my case, my external paging/sorting is handled the exact same way across the application.
Please tell us about your environment:
Windows 7, VSCode, yarn/npm, undertow/tomcat
Table version: 0.7.x
current, see plunkr
Angular version: 2.0.x
current, see plunkr
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome
Language: [all | TypeScript X.X | ES6/7 | ES5]
Typescript 2.2.1
The text was updated successfully, but these errors were encountered: