To use const instead of var produces, according to @wwelling:
Firefox 127.0 (Ubuntu 0.0.0) controller: NotificationController Are the scope methods working as expected resetNotifications should reset notifications FAILED
TypeError: invalid assignment to const 'notification' in tests/unit/controllers/notificationControllerTest.js (line 90)
@tests/unit/controllers/notificationControllerTest.js:90:13
<Jasmine>
The existing code should either be replaces to avoid const or the problems should be identified and resolved and then the const should be used instead of var.
Note that changing the var to const is a bigger task and may not be worth the effort for an old AngularJS project.
It may be more worth the effort to just use var instead of const consistently.
see: https://github.com/TAMULib/LibraryServiceStatusSystemUI/blob/2809f72219d3f014cd6b543b9cff4718d0563172/app/controllers/notificationController.js#L68
Changing some code such as this:
To use
const
instead ofvar
produces, according to @wwelling:The existing code should either be replaces to avoid
const
or the problems should be identified and resolved and then theconst
should be used instead ofvar
.Note that changing the
var
toconst
is a bigger task and may not be worth the effort for an old AngularJS project. It may be more worth the effort to just usevar
instead ofconst
consistently.