javascript - Using angular-datatables DTOptions In Controller -
I am using in a project. I'm using it like this:
& lt; Table datatable = "ng" class = "table-bordered table" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Id & lt; / Th & gt; & Lt; Th & gt; First & lt; / Th & gt; & Lt; Th & gt; Last & lt; / Th & gt; & Lt; Th & gt; Business & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt; Tr ng-repeat = "people in people" & gt; & Lt; TD & gt; {{Person.Id}} & lt; / TD & gt; & Lt; TD & gt; {{Person.FirstName}} & lt; / TD & gt; & Lt; TD & gt; {{Person.LastName}} & lt; / TD & gt; & Lt; TD & gt; {{Person.Job}} & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;
Strange, the table render however, it does not behave like a data table. The layoffs are not loaded. Do I have a way to see if the datatabase
is loaded? In my page, I have the following: link href = "/ libs / datatables / media / css / jquery.dataTables.min.css" rel = "stylesheet" />
& lt; & Lt; Link href = "/ libs / angular-datatables / dist / datatables.bootstrap.min.css" rel = "stylesheet" /> & Lt; Script src = "/ libs / jquery / dist / jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "/ libs / datatables / media / js / jquery.dataTables.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "/ libs / angle / angular me. Js" & gt; & Lt; / Script & gt; & Lt; Script src = "/ libs / angular-datatables / dist / angular-datatables.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "/ js / app.js" & gt; & Lt; / Script & gt; Angular Bootstrap ($ ('# myApp'), ['myApp']);
MyApp is manually bootstrap because there are multiple applications on the page under app.js
:
'Strict Use the'; Var myApp = angular.module ('myApp', ['ngmmat', 'UI. Bootstrap', 'datable', 'app quotation']); MyApp.controller ('MyController', ['$ theme-area', function ($ scope, DTOptionsBuilder, DTColumnDefBuilder) {console.log (DTOptionsBuilder);}]);
Console. The log statement prints undefined
. This means that the datatable
is not being loaded. However, I'm not sure how to confirm it I do not see any 404 in my console window, so, I think I'm downloading the required libraries at least. It looks like I'm not doing the injection properly with datatable
However, it looks right to me, even though sorting is not working and DTOptionsBuilder
is undefined printing .
Am I doing wrong?
inline array annotations
is done properly to do this Correct method for:
myApp.controller , 'DTColumnDefBuilder', function ($ scope, DTOptionsBuilder, DTColumnDefBuilder) {console.log (DTOptionsBuilder);}]);
Comments
Post a Comment