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

The regex in NGRenderer's render method is wrong

Open AdirAmsalem opened this issue 12 years ago • 1 comments

The NGRenderer.render method is trying to detect the data source of the ngRepeat in order to register a watcher on it and update the table when it changes, it does that with a regex that reads the ngRepeat comment.

Currently, the regex is: "/^\s_.+\s+in\s+(\w_)\s*/", which is fine for expressions such "item in items" and etc.

The problem occurs when the expression contains characters such "." (a dot), which happens when the data source is nested inside another property (data.items) or when the "controllerAs" syntax is being used (MainCtrl.items).

When the situation described above happens, the watcher doesn't works properly and the data in the table doesn't reflects the associated data correctly.

A PR that fix this issue will be included in the next minutes.

AdirAmsalem avatar Sep 18 '14 15:09 AdirAmsalem

:+1:

l-lin avatar Sep 18 '14 15:09 l-lin