Controllers add methods to the scope associated with them, so basically you
can wrap given method by:
myApp.factory('AfterAdvice', function () {
return function AfterAdvice() {
console.log('After advice');
};
});
function MyCtrl($scope, AfterAdvice) {
$scope.foo = execute(AfterAdvice);
}).after(function () {
console.log('Controller function...');
});
}
Unfortunately you cannot use the `config` callback.
On Thursday, 18 September 2014 06:56:53 UTC+3, 徐璟 wrote:
>
> I wanna know whether I can annotate aspects into functions in controllers
>
> 在 2013年8月7日星期三UTC+8下午9时11分55秒,Minko Gechev写道:
>>
>> Hello guys,
>>
>> I've always made some parallels between SpringSource and AngularJS - at
>> least the DI and abstraction they provide.
>> The next key aspect from SpringSource which I think might be useful while
>> developing AngularJS applications is the AOP (Aspect-Oriented Programming).
>>
>> I built a simple AOP framework for AngularJS which can be found at
>> https://github.com/mgechev/angular-aop
>>
>> I tried to make it with the simplest possible interface, I hope it'll be
>> useful for you. It's totally open for contributions if you have ideas for
>> it!
>>
>> Best regards,
>> Minko.
>>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.