How can i use editor in Angular?

How can i use editor in Angular?

Muhammad Arsal AbdullahMuhammad Arsal Abdullah Posts: 1Questions: 1Answers: 0
edited June 2017 in Free community support

I'm using editor in angular 4.
I've included all the scripts in .angular-cli.json:
"scripts": [ "../node_modules/jquery/dist/jquery.js", "../node_modules/datatables.net/js/jquery.dataTables.js", "../node_modules/datatables.net-buttons/js/dataTables.buttons.js", "../node_modules/datatables.net-buttons/js/buttons.colVis.js", "../node_modules/datatables.net-buttons/js/buttons.flash.js", "../node_modules/datatables.net-buttons/js/buttons.html5.js", "../node_modules/datatables.net-buttons/js/buttons.print.js", "../node_modules/datatables.net-editor/js/dataTables.editor.js" ]

When I try to instantiate editor instance using:
var editor = new $.fn.dataTable.Editor( {} );
it says 'dataTable' does not exist on type 'JQuery'.

How can I make it work?

Answers

  • jarrettjjarrettj Posts: 13Questions: 4Answers: 0

    +1

  • allanallan Posts: 63,461Questions: 1Answers: 10,466 Site admin

    Is that just a TypeScript error that is occuring during compilation, or is it happening in your browser? If TypeScript, then try:

    var editor = new <any>($.fn).dataTable.Editor( {} );
    

    Allan

  • jahnelgroupjahnelgroup Posts: 6Questions: 1Answers: 0

    @allan this solution didn't work for me

This discussion has been closed.