Use angular one-time-binding to improve performance

Use angular one-time-binding for static strings to improve
performance.

Change-Id: I6dcfa44460b1facc3a697c9cd8792b7311fbadb4
This commit is contained in:
Peter Piela 2017-02-10 09:04:23 -05:00 committed by Julia Kreger
parent 3fc9f6039a
commit d6e5ab2ecb
5 changed files with 26 additions and 26 deletions

View File

@ -6,7 +6,7 @@
aria-label="Close">
<span aria-hidden="true" class="fa fa-times"></span>
</button>
<h3 class="modal-title" translate>{$ ctrl.modalTitle $}</h3>
<h3 class="modal-title" translate>{$ ::ctrl.modalTitle $}</h3>
</div>
<!-- begin general node info modal -->
<div class="modal-body">
@ -50,7 +50,7 @@
id="name"
name="name"
ng-pattern="ctrl.validHostNameRegex"
placeholder="{$ 'A unique node name. Optional.' | translate $}"/>
placeholder="{$ ::'A unique node name. Optional.' | translate $}"/>
</div>
</div>
<!--node driver-->
@ -238,6 +238,6 @@
ng-click="ctrl.submit()"
class="btn btn-primary"
translate>
{$ ctrl.submitButtonTitle $}
{$ ::ctrl.submitButtonTitle $}
</button>
</div>

View File

@ -6,7 +6,7 @@
aria-label="Close">
<span aria-hidden="true" class="fa fa-times"></span>
</button>
<h3 class="modal-title">{$ ctrl.modalTitle $}</h3>
<h3 class="modal-title">{$ ::ctrl.modalTitle $}</h3>
</div>
<div class="modal-body">
<form id="CreatePortForm" name="CreatePortForm">
@ -26,7 +26,7 @@
ng-required="true"
ng-pattern="'([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})'"
auto-focus
placeholder="{$ 'MAC address for this port. Required.' | translate $}"/>
placeholder="{$ ::'MAC address for this port. Required.' | translate $}"/>
</div>
</div>
<div class="form-group">
@ -101,7 +101,7 @@
type="text"
ng-model="extraName"
validate-unique="ctrl.checkExtraUnique"
placeholder="{$ 'Property Name' | translate $}"/>
placeholder="{$ ::'Property Name' | translate $}"/>
<span class="input-group-btn">
<button class="btn btn-primary"
type="button"
@ -147,6 +147,6 @@
ExtraForm.$invalid"
ng-click="ctrl.submit()"
class="btn btn-primary">
{$ ctrl.submitButtonTitle $}
{$ ::ctrl.submitButtonTitle $}
</button>
</div>

View File

@ -13,26 +13,26 @@
callback="ctrl.actions.powerOn"
item="ctrl.node"
disabled="ctrl.node.power_state!=='power off'">
{$ 'Power on' | translate $}
{$ ::'Power on' | translate $}
</action>
<menu>
<action button-type="menu-item"
callback="ctrl.actions.powerOff"
item="ctrl.node"
disabled="ctrl.node.power_state!=='power on'">
{$ 'Power off' | translate $}
{$ ::'Power off' | translate $}
</action>
<action button-type="menu-item"
callback="ctrl.maintenanceService.putNodeInMaintenanceMode"
item="[ctrl.node]"
disabled="ctrl.node.maintenance">
{$ 'Maintenance on' | translate $}
{$ ::'Maintenance on' | translate $}
</action>
<action button-type="menu-item"
callback="ctrl.maintenanceService.removeNodeFromMaintenanceMode"
item="[ctrl.node]"
disabled="!ctrl.node.maintenance">
{$ 'Maintenance off' | translate $}
{$ ::'Maintenance off' | translate $}
</action>
<li role="presentation"
ng-repeat="transition in ctrl.nodeStateTransitions">
@ -47,7 +47,7 @@
</li>
<action button-type="menu-item"
callback="ctrl.editNode">
{$ 'Edit' | translate $}
{$ ::'Edit' | translate $}
</action>
</menu>
</action-list>

View File

@ -29,7 +29,7 @@
<action button-type="split-button"
action-classes="'btn btn-default btn-sm'"
callback="ctrl.createPort">
{$ 'Create port' | translate $}
{$ ::'Create port' | translate $}
</action>
<menu>
<action button-type="menu-item"
@ -37,7 +37,7 @@
item="tCtrl.selected"
disabled="tCtrl.selected.length === 0">
<span class="fa fa-trash"></span>
{$ 'Delete ports' | translate $}
{$ ::'Delete ports' | translate $}
</action>
</menu>
</action-list>

View File

@ -35,33 +35,33 @@
callback="table.actions.powerOnAll"
item="tCtrl.selected"
disabled="tCtrl.selected.length === 0">
{$ 'Power on' | translate $}
{$ ::'Power on' | translate $}
</action>
<menu>
<action button-type="menu-item"
callback="table.actions.powerOffAll"
item="tCtrl.selected"
disabled="tCtrl.selected.length === 0">
{$ 'Power off' | translate $}
{$ ::'Power off' | translate $}
</action>
<action button-type="menu-item"
callback="table.maintenanceService.putNodeInMaintenanceMode"
item="tCtrl.selected"
disabled="tCtrl.selected.length === 0">
{$ 'Maintenance on' | translate $}
{$ ::'Maintenance on' | translate $}
</action>
<action button-type="menu-item"
callback="table.maintenanceService.removeNodeFromMaintenanceMode"
item="tCtrl.selected"
disabled="tCtrl.selected.length === 0">
{$ 'Maintenance off' | translate $}
{$ ::'Maintenance off' | translate $}
</action>
<action button-type="menu-item"
callback="table.actions.deleteNode"
item="tCtrl.selected"
disabled="tCtrl.selected.length === 0">
<span class="fa fa-trash"></span>
{$ 'Delete nodes' | translate $}
{$ ::'Delete nodes' | translate $}
</action>
</menu>
</action-list>
@ -139,38 +139,38 @@
callback="table.actions.powerOn"
disabled="node.power_state !== 'power off'"
item="node">
{$ 'Power on' | translate $}
{$ ::'Power on' | translate $}
</action>
<menu>
<action button-type="menu-item"
callback="table.actions.powerOff"
disabled="node.power_state !== 'power on'"
item="node">
{$ 'Power off' | translate $}
{$ ::'Power off' | translate $}
</action>
<action button-type="menu-item"
callback="table.maintenanceService.putNodeInMaintenanceMode"
item="[node]"
disabled="node.maintenance">
{$ 'Maintenance on' | translate $}
{$ ::'Maintenance on' | translate $}
</action>
<action button-type="menu-item"
callback="table.maintenanceService.removeNodeFromMaintenanceMode"
item="[node]"
disabled="!node.maintenance">
{$ 'Maintenance off' | translate $}
{$ ::'Maintenance off' | translate $}
</action>
<action button-type="menu-item"
callback="table.actions.deleteNode"
disabled="!(node.provision_state === 'available' || node.provision_state === 'nostate' || node.provision_state === 'manageable' || node.provision_state === 'enroll')"
item="[node]">
<span class="fa fa-trash"></span>
{$ 'Delete node' | translate $}
{$ ::'Delete node' | translate $}
</action>
<action button-type="menu-item"
callback="table.actions.createPort"
item="node">
{$ 'Create port' | translate $}
{$ ::'Create port' | translate $}
</action>
<li role="presentation"
ng-repeat="transition in table.getNodeStateTransitions(node)">
@ -186,7 +186,7 @@
<action button-type="menu-item"
callback="table.editNode"
item="node">
{$ 'Edit' | translate $}
{$ ::'Edit' | translate $}
</action>
</menu>
</action-list>