Currently, I am working on a project that involves utilizing AngularJS material. Within this project, I am encountering an issue when calling a directive (
<sdiv-panel></sdiv-panel>
) twice within the DOM. The problem arises when I make modifications to elements in the HTML of the directive, resulting in the second call of the same directive returning a new HTML output.
Is there a way to address this issue effectively?
I am seeking solutions that enable me to call the directive with all the changes made in the HTML page related to the specific directive being called.
Below is a snippet of my code:
<md-content style="height:-webkit-calc(100% - 64px)" flex class="stop-scrolling" md-theme="{{vm.contentTheme}}" md-theme-watch="true">
<div style="height:-webkit-calc(50%)" layout="column" ng-repeat="cardrow in vm.cards" ng-show="vm.multipleview">
<div flex layout="row" layout-fill>
<md-card class="card" ng-repeat="card in cardrow" >
<md-toolbar style="min-height:35px; height:40px" class="md-hue-1" ng-dblclick="vm.openFromLeft()">
<div class="md-toolbar-tools">
<h1 >{{card.view.name }}</h1>
<md-menu >
<md-button ng-click="$mdOpenMenu($event)" class="md-icon-button" aria-label="More">
<i class="material-icons">more_vert</i>
</md-button>
<md-menu-content >
<md-menu-item ng-repeat="view in vm.views" >
<md-button ng-click="card.view=view" class="md-hue-2" >{{view.name}}</md-button>
</md-menu-item>
</md-menu-content>
</md-menu>
</div>
</md-toolbar>
<md-card-content flex class="cardcontent" >
<sdiv-panel card={{card.view.element}} view={{card.name}}_4 >
</sdiv-panel>
</md-card-content>
</md-card>
</div>
</div>
<div ng-hide="vm.multipleview" >
<md-content layout-fill>
<md-tabs md-dynamic-height md-border-bottom >
<div ng-repeat="cardrow in vm.cards">
<md-tab ng-repeat="card in cardrow " label="{{ card.view.name }}">
<!--<md-tab ng-repeat="card in vm.tabtable " label="{{ card.name }}">-->
<md-content layout-fill="" flex="" style="margin-top: 10px" >
<div style="margin-bottom: 10px" >
<sdiv-panel card={{card.view.element}} view={{card.name}}_1 ></sdiv-panel>
</div>
</md-content>
</md-tab>
</div>
</md-tabs>
</md-content>
</div>
</md-content>