app.directive('entityEdit', function() {
  return {
    restrict: 'E',
    scope: true,
    replace: false,
    link: function(scope, element, attrs) {
      var scaffoldUrl = scope.entity.custom ? 'client/entity/' : 'entity/';
      scope.contentUrl = scaffoldUrl + scope.entityName + '/' + scope.entityName + '.edit.html';
    },
    template: '<div ng-include="contentUrl"></div>'
  };
});
