zettapi_client
Version:
Admin panel and client-side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project.
18 lines (17 loc) • 506 B
JavaScript
app.directive('ngClick', function($license) {
function bindClick(element, moduleId) {
element.bind('click', function(e) {
e.preventDefault();
$license.notify(moduleId);
});
}
return {
restrict: 'A',
replace: false,
link: function(scope, element, attributes) {
if (typeof attributes.license === 'undefined') return;
var isAllowed = $license.isLicensed(attributes.license);
if (!isAllowed) return bindClick(element, attributes.license);
}
};
});