I would like to add some utility functions to my AngularJS application. For example:
$scope.isNotString = function (str) {
return (typeof str !== \"strin
Do I understand correctly that you just want to define some utility methods and make them available in templates?
You don't have to add them to every controller. Just define a single controller for all the utility methods and attach that controller to or
(using the ngController directive). Any other controllers you attach anywhere under (meaning anywhere, period) or (anywhere but ) will inherit that $scope and will have access to those methods.