you can use the following directive:
// ************************************* // // this directive is an ng-disabled directive for everyone elements, not just for the button // ************************************* //
app.directive('disabledElement', function () { return { restrict: 'A', scope: { disabled: '@' }, link: function (scope, element, attrs) { scope.$parent.$watch(attrs.disabledElement, function (newVal) { if (newVal) $(element).css('pointerEvents', 'none'); else $(element).css('pointerEvents', 'all'); }); } } });
and html:
<div ng-click="PreviewMobile()" data-disabled-element="toolbar_lock"></div>
Lax
source share