Is there a character limit for the parameter being sent to this directive? I'm encountering an issue with my code:
header = JSON.stringify(header);
columnObj = JSON.stringify(columnObj);
$compile('<div column-filter-sort header=' + header + ' columnobj=' + columnObj + '></div>')(scope);
Directive:
a.directive('columnFilterSort', function () {
return {
link: function (scope, elem, attrs) {
var columnObj = JSON.parse(attrs.columnobj);
var header = JSON.parse(attrs.header);
}
});
The variable columnObj appears correct, but there is an issue when parsing var header = JSON.parse(attrs.header); Upon inspecting var header, it seems incomplete. The error message suggests: SyntaxError: Unexpected end of input at Object.parse (native)
I would appreciate any assistance.
Thank you