Skip to content

Commit

Permalink
fix: cache inner template (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Bourgois authored and antleblanc committed Mar 16, 2020
1 parent b47c7e2 commit 646697c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/components/ng-ovh-actions-menu/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import directive from './directive';
import factory from './factory';
import provider from './provider';

import innerTemplate from './template-inner.html';

import './index.less';

const moduleName = 'ngOvhActionsMenu';
Expand All @@ -41,6 +43,9 @@ angular
.directive('actionsMenu', directive)
.factory('ActionsMenu', factory)
.provider('actionsMenu', provider)
.run(/* @ngInject */($templateCache) => {
$templateCache.put('ng-ovh-actions-menu/template-inner.html', innerTemplate);
})
.run(/* @ngTranslationsInject ./translations */);

export default moduleName;
2 changes: 1 addition & 1 deletion packages/components/ng-ovh-actions-menu/src/template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<button type="button"
class="actions-menu-button"
data-ng-class="{ 'menu-open' : $ctrl.popoverSettings.isOpen }"
data-responsive-popover="'template-inner.html'"
data-responsive-popover="'ng-ovh-actions-menu/template-inner.html'"
data-popover-class="{{ $ctrl.popoverSettings.class ? $ctrl.popoverSettings.class + ' ovh-angular-actions-menu' : 'ovh-angular-actions-menu' }}"
data-popover-placement="{{ $ctrl.popoverSettings.placement }}"
data-popover-trigger="{{ $ctrl.popoverSettings.trigger }}"
Expand Down

0 comments on commit 646697c

Please sign in to comment.