angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

Not working with debugInfoEnabled

Open jongunter opened this issue 10 years ago • 6 comments

Check out this Plunker: http://plnkr.co/edit/6a9gpjI3ThNflmsyslrZ?p=preview It's using strict dependency injection mode and debugInfoEnabled is turned on. I get the following error when my datatable is compiled angular.js:13550Error: Expected expression in form of "_item_ in _collection_[ track by _id_]" but got "{0}".

As soon as I turn off debugInfoEnabled, the table works again. Please let me know how we can fix this, or implement a possible workaround.

Thanks so much for your help!

jongunter avatar May 31 '16 16:05 jongunter

Hmm interesting...

l-lin avatar Jun 01 '16 11:06 l-lin

Funny, I was facing the same issue. I made it false because of this. https://medium.com/swlh/improving-angular-performance-with-1-line-of-code-a1fb814a6476#.n18oj2n8p

GeorgeChackungal avatar Jun 14 '16 15:06 GeorgeChackungal

If debugInfoEnabled = false is set, it will fail in angular_datatables.js (version 0.3.1) on line 1395 because it searches for an Angular comment that doesn't exists:

// Find the resources from the comment <!-- ngRepeat: item in items --> displayed by angular in the DOM
// This regexp is inspired by the one used in the "ngRepeat" directive
match = expression.match(/^\s*.+?\s+in\s+(\S*)\s*/),

ModuLIZER avatar Jun 23 '16 13:06 ModuLIZER

Mmh this will be bit tricky since _expression.match(/^\s*.+?\s+in\s+(\S*)\s*/m); will return <!-- -->. I guess we need to apply the regexp in the staticHTML instead...

l-lin avatar Jul 05 '16 16:07 l-lin

I made a correction. I don't really know if that works for all use cases. Can you guys try to apply this correction on your use case and tell me if that works? Thanks :smile:

l-lin avatar Jul 05 '16 17:07 l-lin

I also had this bug, but I've checked out the dev branch with the @l-lin's fix and it worked. I think it can be closed and go to release.

Thanks, @l-lin

ggondim avatar Jul 26 '16 17:07 ggondim