title: How to use Angular directive in Salesforce
body: <p>How to use angular directive in Salesforce
  My directive html page</p>
  
  <pre><code>&lt;apex:page showHeader="false" sidebar="false" standardStylesheets="false" applyHtmlTag="false"&gt;
    &lt;td&gt;
      &lt;div class="address-container"&gt;
          &lt;p data-once-text="addr.company"&gt;&lt;/p&gt;
          &lt;p&gt;&lt;span class="once-addr" data-once-text="addr.city"&gt;&lt;/span&gt;, &lt;span class="once-addr" data-once-text="addr.state"&gt;&lt;/span&gt;&lt;/p&gt;
          &lt;p&gt;&lt;a href="javascript:;" details="addr" shipment-details = ''&gt;View&lt;/a&gt; &lt;span&gt;|&lt;/span&gt; &lt;a href="javascript:;" ng-click="removeAddress(acc.id, addr.id)"&gt;Remove&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
  &lt;/td&gt;
  &lt;/apex:page&gt;
  </code></pre>
  
  <p>My directive call </p>
  
  <pre><code>mydirective.directive('shipmentAddress', ['CartService', function(CartService){
      return{
          scope: true,
          replace: true,
          templateUrl: 'apex/shipment_addresses_tplhtml',
          controller: function($scope){
              this.addressInfo = $scope.addr;
              $scope.removeAddress = function(accountId, addrId){
                  if(confirm('Are you sure you want to remove this shipping address?')){
                      CartService.deleteCartAddress(accountId, addrId).then(function(response){
                          console.log(response);
                          $scope.$emit('refreshCart');
                      });
                  }
              }
          }
      }
  }]);
  </code></pre>
  
  <p>in my index.html</p>
  
  <pre><code> &lt;tr class="addresses"&gt;
      &lt;td shipment-address  ng-repeat="addr in acc.addresses" ng-if="addr.added == true"&gt;&lt;/td&gt;
   &lt;/tr&gt;
  </code></pre>
  
  <p>But I am getting error in SaleForce/VisualForce as <strong>Attribute name &quot;shipment-address&quot; associated with an element type "td" must be followed by the ' = ' character.</strong></p>