How to call an application controller method from angular js directive
问题 Hi I want to make a validation directive. It basically will call a remote validation on the server. I would expect something like this: <input type="text" id="nome" required ng-model="client.context" available="checkAvailableContexts"> and that should call a method on my ClientController like this: $scope.checkAvailableContexts = function(contexto, callbacks) { service.checkContextAvailability(contexto, callbacks); } and this is my service method: this.checkContextAvailability = function