TypeError: $(_this.el.nativeElement).DataTable is not a function. (In '$(_this.el.nativeElement).DataTable(dtOptions)', '$(_this.el.nativeElement).DataTable' is undefined
See original GitHub issueI’m submitting a…
[*] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Question
Current behavior
In installed all the requirements to import angular datatable as provided in doc. But after importing when i added a basic table in my angular 6 project nothig works and error is flagged in console!
Why this happen any fix for this! Is this an issue still open?
app-module.ts
import { DataTablesModule } from 'angular-datatables';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
ReactiveFormsModule,
DataTablesModule.forRoot(),
ContextMenuModule.forRoot({
useBootstrap4: true,
}),
AppRoutingModule,
HttpClientModule
],
providers: [
AuthGuard,
AuthService,
UserService,
{
provide: HTTP_INTERCEPTORS,
useClass: JwtInterceptor,
multi: true
}
],
bootstrap: [AppComponent]
})
export class AppModule { }
Environment
- node version: v8.11.3
- angular version: 6
- angular-cli version: 6.1.5
- jquery version: 3.3.6
- datatables version: 1.10.19
- angular-datatables version: 6.00
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
DataTable is not a function TypeError while ... - Stack Overflow
Hi are you sure the _this is correctly setted with your this of the component? .. have you tried something like:
Read more >Uncaught TypeError: $(…).DataTable is not a function (when ...
I'm trying to use https://datatables.net/ jquery datatables for my angular 5 project to nicely display some data.
Read more >TypeError: $(...).DataTable is not a function in jQuery
The "$(...).DataTable is not a function" jQuery error occurs for multiple reasons: Forgetting to include the DataTables library. Loading the DataTables library ...
Read more >DataTable is not a function TypeError while using angular ...
Coding example for the question DataTable is not a function TypeError while using angular-datatables for Angular 4-angular.js.
Read more >Developers - TypeError: $(_this.el.nativeElement).DataTable is not a ...
nativeElement).DataTable is not a function. (In '$(_this.el.nativeElement).DataTable(dtOptions)', '$(_this.el.nativeElement).DataTable' is undefined.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in angular-datatables/src/angular-datatables.directive.ts should be import of jquery
import * as $ from 'jquery'
This issue has been closed due to inactivity. Please feel free to re-open the issue to add new inputs.