Browse Source

chore(core): change the class name of stop-propagation.directive

pull/6641/head
mehmet-erim 7 years ago
parent
commit
c24afe6982
  1. 6
      npm/ng-packs/packages/core/src/lib/core.module.ts
  2. 2
      npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts
  3. 10
      npm/ng-packs/packages/core/src/lib/tests/stop-propagation.directive.spec.ts

6
npm/ng-packs/packages/core/src/lib/core.module.ts

@ -16,7 +16,7 @@ import { EllipsisDirective } from './directives/ellipsis.directive';
import { ForDirective } from './directives/for.directive'; import { ForDirective } from './directives/for.directive';
import { FormSubmitDirective } from './directives/form-submit.directive'; import { FormSubmitDirective } from './directives/form-submit.directive';
import { PermissionDirective } from './directives/permission.directive'; import { PermissionDirective } from './directives/permission.directive';
import { ClickEventStopPropagationDirective } from './directives/stop-propagation.directive'; import { StopPropagationDirective } from './directives/stop-propagation.directive';
import { VisibilityDirective } from './directives/visibility.directive'; import { VisibilityDirective } from './directives/visibility.directive';
import { ApiInterceptor } from './interceptors/api.interceptor'; import { ApiInterceptor } from './interceptors/api.interceptor';
import { ABP } from './models/common'; import { ABP } from './models/common';
@ -54,7 +54,7 @@ import './utils/date-extensions';
PermissionDirective, PermissionDirective,
VisibilityDirective, VisibilityDirective,
InputEventDebounceDirective, InputEventDebounceDirective,
ClickEventStopPropagationDirective, StopPropagationDirective,
AbstractNgModelComponent, AbstractNgModelComponent,
], ],
exports: [ exports: [
@ -75,7 +75,7 @@ import './utils/date-extensions';
VisibilityDirective, VisibilityDirective,
InputEventDebounceDirective, InputEventDebounceDirective,
LocalizationPipe, LocalizationPipe,
ClickEventStopPropagationDirective, StopPropagationDirective,
AbstractNgModelComponent, AbstractNgModelComponent,
], ],
providers: [LocalizationPipe], providers: [LocalizationPipe],

2
npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts

@ -6,7 +6,7 @@ import { takeUntilDestroy } from '../utils/rxjs-utils';
// tslint:disable-next-line: directive-selector // tslint:disable-next-line: directive-selector
selector: '[click.stop]', selector: '[click.stop]',
}) })
export class ClickEventStopPropagationDirective implements OnInit, OnDestroy { export class StopPropagationDirective implements OnInit, OnDestroy {
@Output('click.stop') readonly stopPropEvent = new EventEmitter<MouseEvent>(); @Output('click.stop') readonly stopPropEvent = new EventEmitter<MouseEvent>();
constructor(private el: ElementRef) {} constructor(private el: ElementRef) {}

10
npm/ng-packs/packages/core/src/lib/tests/stop-propagation.directive.spec.ts

@ -1,14 +1,14 @@
import { createDirectiveFactory, SpectatorDirective } from '@ngneat/spectator/jest'; import { createDirectiveFactory, SpectatorDirective } from '@ngneat/spectator/jest';
import { ClickEventStopPropagationDirective } from '../directives/stop-propagation.directive'; import { StopPropagationDirective } from '../directives/stop-propagation.directive';
describe('ClickEventStopPropagationDirective', () => { describe('StopPropagationDirective', () => {
let spectator: SpectatorDirective<ClickEventStopPropagationDirective>; let spectator: SpectatorDirective<StopPropagationDirective>;
let directive: ClickEventStopPropagationDirective; let directive: StopPropagationDirective;
let link: HTMLAnchorElement; let link: HTMLAnchorElement;
const childClickEventFn = jest.fn(() => null); const childClickEventFn = jest.fn(() => null);
const parentClickEventFn = jest.fn(() => null); const parentClickEventFn = jest.fn(() => null);
const createDirective = createDirectiveFactory({ const createDirective = createDirectiveFactory({
directive: ClickEventStopPropagationDirective, directive: StopPropagationDirective,
}); });
beforeEach(() => { beforeEach(() => {

Loading…
Cancel
Save