How can I inject $http to the modal directive using es6? I Tried do it like this but I get $http = undefined. At finally i'm trying vcRecaptchaService but have same problem.
class ModalDirective {
/**
* Constructor class ModalDirective
*/
constructor($http) {
this.restrict = 'E',
this.scope = {
show: '=',
subm: '=',
emailState: '=',
requestResult: '='
},
this.transclude = true,
this.template = require('./modal.tpl.html');
this.$http = $http
}
link(scope, attrs) {
scope.dialogStyle = {};
scope.formData = {};
scope.hideModal = function() {
scope.show = false;
};
console.log(this.$http);
}
}
export default ModalDirective;