angular-summernote icon indicating copy to clipboard operation
angular-summernote copied to clipboard

Service provider for default behaviour

Open zaalbarxx opened this issue 10 years ago • 3 comments

Hi! I think it would be a good idea to create some provider for this module to allow for some default behaviour for all instances of Summernote. For now every time you want to put some config you have to copy-paste it to every instance, it would be much better to typically merge some settings from provider(mostly thinking about some global handlers for events like for example save or paste) with the ones passed to directive to allow for some global configuration. What do you think ?

zaalbarxx avatar Oct 09 '15 12:10 zaalbarxx

It looks good idea, but I'm considering what interfaces it should expose and how it should support. Did you see such kind of directive you said in other project?

outsideris avatar Oct 12 '15 18:10 outsideris

Most likely it should expose the way to create some global actions for certain events. In my case it would be just perfect if I would be able to make some action every time the text is pasted into the editor, no matter which one. For now I would have to find every single instance of Summernote in my project and manually add handlers for that. With providers I could just configure it via provider and forget about it.

zaalbarxx avatar Oct 13 '15 08:10 zaalbarxx

+1

And also we can register the configuration for each directive inside this service, better than using the scope for that.

dhoko avatar May 09 '16 09:05 dhoko