Angular service that converts camel case strings to hyphenated
The function used can be found here
Unfortunately, it is not available through API.
lodash has method kebabCase that does exactly this.
I used the below code to convert the Camelcase string into directive name format.
myApp.filter(`con2directivename`,function(){
return function(name){
return name.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();});
};
});