Typically directives fail silently rather than throwing an error like this:

5546 scope.notificationGroups.forEach should prob check if there is an array before looping. If throwing an error is preferred, a more descriptive error message would be helpful.