Q:

Angular attributes on directives

I don't understand what the attribute is doing in this case:
<div my-custom-directive="what does this do?"></div>

A real world example:
 <div class="grid" ui-grid="gridOptionsSimple"> </div>

It isn't to pass in attributes to the linking function because you might do this like this:
<div my-custom-attribute="what does this do?" extra-attribute="123"></div>

It looks like it creates a property on the scope. But that's as far as I've got. Sorry. Quite a beginner question.

A:

In the case of ui-grid="gridOptionsSimple" it's passing along the value of gridOptionsSimple on the parent scope into UI-Grid's isolate scope.
If you check out the source for the ui-grid directive (here: https://github.com/angular-ui/ng-grid/blob/v3.0.0-rc.22/src/js/core/directives/ui-grid.js#L196) you'll see that the directive is specifying that the uiGrid ("ui-"grid in snake-case) scope property is bound to the uiGrid attribute ('=' is just short for '=uiGrid').
return {
  templateUrl: 'ui-grid/ui-grid',
  scope: {
    uiGrid: '='
  },
  replace: true,
  transclude: true,
  ...
};

This allows to the grid to get all the options and data references into its own scope without dirtying and parent controller scope.

