app.directive('entityView', 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 + '.view.html';
    },
    template: '<div ng-include="contentUrl"></div>'
  };
});
