Using ES6 and webpack in my angular project, and trying how to compile a dynamically added angular material directive to my input.
My Directive looks like this
class addMaxLength {
constructor() {
this.restrict = 'A';
this.scope = {
maxLength : '='
};
}
// optional link function
link(scope, element, attributes) {
if(scope.maxLength > 0){
element.attr('md-maxlength',scope.maxLength);
}
}
}
addMaxLength.$inject = [];
export { addMaxLength };
And trying to see how I can compile the input then to show the new attribute on my input ?