zettapi_client
Version:
Client side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project
13 lines (12 loc) • 414 B
JavaScript
app.directive('entityView', function(zapiPath) {
return {
restrict: 'E',
scope: true,
replace: false,
link: function(scope, element, attrs) {
var scaffoldUrl = scope.entity.custom ? 'client/entity/' : (zapiPath + 'entity/');
scope.contentUrl = scaffoldUrl + scope.entityName + '/' + scope.entityName + '.view.html';
},
template: '<div ng-include="contentUrl"></div>'
};
});