Both of your directives work with a little tweaking to reuse the same module when creating directives instead of overwriting the first. See this script .
Instead of this:
angular.module("app", []).directive('popover1'... angular.module("app", []).directive('popover2'...
Do something like this:
var module = angular.module("app", []); module.directive('popover1'... module.directive('popover2'...
Edit: after looking at the docs, I see that you can do something similar to the original post, ok like this:
angular.module('app', []).directive('popover1'... angular.module('app').directive('popover2'...
Omit the second parameter []
in subsequent calls after the first on angular.module
to configure an existing module.
source share