Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Not working with debugInfoEnabled #746

Closed
jongunter opened this issue May 31, 2016 · 6 comments
Closed

Not working with debugInfoEnabled #746

jongunter opened this issue May 31, 2016 · 6 comments
Labels
Milestone

Comments

@jongunter
Copy link

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!

@l-lin
Copy link
Owner

l-lin commented Jun 1, 2016

Hmm interesting...

@GeorgeChackungal
Copy link

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

@ModuLIZER
Copy link

ModuLIZER commented Jun 23, 2016

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*/),

@l-lin
Copy link
Owner

l-lin commented Jul 5, 2016

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 added a commit that referenced this issue Jul 5, 2016
@l-lin
Copy link
Owner

l-lin commented Jul 5, 2016

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 😄

@ggondim
Copy link

ggondim commented Jul 26, 2016

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

@l-lin l-lin closed this as completed Sep 1, 2016
l-lin added a commit that referenced this issue Sep 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants