Skip to content

Commit 3f7de38

Browse files
authored
Merge pull request #142 from IKatsuba/feature/rename-directives
feat(ngx-ssr-platform): rename directives
2 parents ed06d3a + 7b67978 commit 3f7de38

6 files changed

+20
-20
lines changed

libs/ngx-ssr/platform/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * from './lib/is-server.directive';
2-
export * from './lib/is-browser.directive';
1+
export * from './lib/if-is-server.directive';
2+
export * from './lib/if-is-browser.directive';
33
export * from './lib/ngx-ssr-platform.module';
44
export * from './lib/tokens';

libs/ngx-ssr/platform/src/lib/is-browser.directive.spec.ts libs/ngx-ssr/platform/src/lib/if-is-browser.directive.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { IsBrowserDirective } from './is-browser.directive';
1+
import { IfIsBrowserDirective } from './if-is-browser.directive';
22
import { render, screen } from '@testing-library/angular';
33
import { IS_BROWSER_PLATFORM } from './tokens';
44

55
describe('IsBrowserDirective', () => {
66
it('should create an element', async () => {
7-
await render(IsBrowserDirective, {
8-
template: '<div *isBrowser>Some text</div>',
7+
await render(IfIsBrowserDirective, {
8+
template: '<div *ifIsBrowser>Some text</div>',
99
providers: [
1010
{
1111
provide: IS_BROWSER_PLATFORM,
@@ -20,8 +20,8 @@ describe('IsBrowserDirective', () => {
2020
});
2121

2222
it('should not create an element', async () => {
23-
await render(IsBrowserDirective, {
24-
template: '<div *isBrowser>Some text</div>',
23+
await render(IfIsBrowserDirective, {
24+
template: '<div *ifIsBrowser>Some text</div>',
2525
providers: [
2626
{
2727
provide: IS_BROWSER_PLATFORM,

libs/ngx-ssr/platform/src/lib/is-browser.directive.ts libs/ngx-ssr/platform/src/lib/if-is-browser.directive.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { IS_BROWSER_PLATFORM } from './tokens';
88

99
@Directive({
1010
// eslint-disable-next-line @angular-eslint/directive-selector
11-
selector: '[isBrowser]',
11+
selector: '[ifIsBrowser]',
1212
})
13-
export class IsBrowserDirective {
13+
export class IfIsBrowserDirective {
1414
constructor(
1515
@Inject(IS_BROWSER_PLATFORM) isBrowser: boolean,
1616
templateRef: TemplateRef<any>,

libs/ngx-ssr/platform/src/lib/is-server.directive.spec.ts libs/ngx-ssr/platform/src/lib/if-is-server.directive.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { IsServerDirective } from './is-server.directive';
1+
import { IfIsServerDirective } from './if-is-server.directive';
22
import { render, screen } from '@testing-library/angular';
33
import { IS_SERVER_PLATFORM } from './tokens';
44

55
describe('IsServerDirective', () => {
66
it('should create an element', async () => {
7-
await render(IsServerDirective, {
8-
template: '<div *isServer>Some text</div>',
7+
await render(IfIsServerDirective, {
8+
template: '<div *ifIsServer>Some text</div>',
99
providers: [
1010
{
1111
provide: IS_SERVER_PLATFORM,
@@ -20,8 +20,8 @@ describe('IsServerDirective', () => {
2020
});
2121

2222
it('should not create an element', async () => {
23-
await render(IsServerDirective, {
24-
template: '<div *isServer>Some text</div>',
23+
await render(IfIsServerDirective, {
24+
template: '<div *ifIsServer>Some text</div>',
2525
providers: [
2626
{
2727
provide: IS_SERVER_PLATFORM,

libs/ngx-ssr/platform/src/lib/is-server.directive.ts libs/ngx-ssr/platform/src/lib/if-is-server.directive.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { IS_SERVER_PLATFORM } from './tokens';
88

99
@Directive({
1010
// eslint-disable-next-line @angular-eslint/directive-selector
11-
selector: '[isServer]',
11+
selector: '[ifIsServer]',
1212
})
13-
export class IsServerDirective {
13+
export class IfIsServerDirective {
1414
constructor(
1515
@Inject(IS_SERVER_PLATFORM) isServer: boolean,
1616
templateRef: TemplateRef<any>,
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
3-
import { IsBrowserDirective } from './is-browser.directive';
4-
import { IsServerDirective } from './is-server.directive';
3+
import { IfIsBrowserDirective } from './if-is-browser.directive';
4+
import { IfIsServerDirective } from './if-is-server.directive';
55

66
@NgModule({
77
imports: [CommonModule],
8-
declarations: [IsBrowserDirective, IsServerDirective],
9-
exports: [IsBrowserDirective, IsServerDirective],
8+
declarations: [IfIsBrowserDirective, IfIsServerDirective],
9+
exports: [IfIsBrowserDirective, IfIsServerDirective],
1010
})
1111
export class NgxSsrPlatformModule {}

0 commit comments

Comments
 (0)