MCPcopy Create free account
hub / github.com/angular-app/angular-app / makeFn

Function makeFn

client/src/common/directives/crud/edit.js:34–40  ·  view source on GitHub ↗
(attrName)

Source from the content-addressed store, hash-verified

32
33 // This function helps us extract the callback functions from the directive attributes
34 var makeFn = function(attrName) {
35 var fn = scope.$eval(attrs[attrName]);
36 if ( !angular.isFunction(fn) ) {
37 throw new Error('crudEdit directive: The attribute "' + attrName + '" must evaluate to a function');
38 }
39 return fn;
40 };
41 // Set up callbacks with fallback
42 // onSave attribute -> onSave scope -> noop
43 var userOnSave = attrs.onSave ? makeFn('onSave') : ( scope.onSave || angular.noop );

Callers 1

edit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected