You cannot do this for a good reason either: Angular's parser expression forbids such things in templates.
If you really want to do this, I recommend explicitly setting the helper methods in $rootScope so that it is available in all of your templates:
mymodal.run(function($rootScope) { $rootScope.typeOf = function(value) { return typeof value; }; });
You can even reference your own Angular utility methods:
mymodal.run(function($rootScope) { ['isArray', 'isDate', 'isDefined', 'isFunction', 'isNumber', 'isObject', 'isString', 'isUndefined'].forEach(function(name) { $rootScope[name] = angular[name]; }); });
and use {{ isArray(arr) }} in the templates.
dfsq
source share