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

View File

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

View File

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

View File

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

View File

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