You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling this service's get method, I get an undefined exception, unless I modify angular-aop.js like this:
//Builds specified aspect
AspectBuilder = {
buildAspect: function (advice, pointcut) {
var self = this;
return function (target, rules) {
// if (typeof target === 'function') {
// return self._getFunctionAspect(target, pointcut, advice);
// } else if (target) {
return self._getObjectAspect(target, rules || {}, pointcut, advice);
// }
};
},
As you may see, I modify the code so buildAspect always return an object aspect. With this modification, the MyAroundAspect gets called, twice per service call.
My solution is not an ideal one, but I'm not using function aspects, so that's fine for me. However, what should be done in order to enable AOP for ngResource without disabling function advices ?
The text was updated successfully, but these errors were encountered:
valir
changed the title
ngResource is gets incorrectly wrapped into a function aspect
ngResource gets incorrectly wrapped into a function aspect
Aug 31, 2014
I'm using angular-aop to put an around advice for the ngResource I use to call server-side API. Like this:
When calling this service's get method, I get an undefined exception, unless I modify angular-aop.js like this:
As you may see, I modify the code so buildAspect always return an object aspect. With this modification, the MyAroundAspect gets called, twice per service call.
My solution is not an ideal one, but I'm not using function aspects, so that's fine for me. However, what should be done in order to enable AOP for ngResource without disabling function advices ?
The text was updated successfully, but these errors were encountered: