(methodName)
| 22 | var original = angular.copy(resource); |
| 23 | |
| 24 | var checkResourceMethod = function(methodName) { |
| 25 | if ( !angular.isFunction(resource[methodName]) ) { |
| 26 | throw new Error('crudEdit directive: The resource must expose the ' + methodName + '() instance method'); |
| 27 | } |
| 28 | }; |
| 29 | checkResourceMethod('$saveOrUpdate'); |
| 30 | checkResourceMethod('$id'); |
| 31 | checkResourceMethod('$remove'); |