Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit caebca4

Browse files
committed
feat(template): migrate UnpatchDirective to standalone API
1 parent 3ed3e97 commit caebca4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

libs/template/unpatch/src/lib/tests/unpatch.directive.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { TestBed } from '@angular/core/testing';
44
import { By } from '@angular/platform-browser';
55

66
import { UnpatchDirective } from '../unpatch.directive';
7-
import { UnpatchModule } from '../unpatch.module';
87

98
describe(UnpatchDirective.name, () => {
109
enum LogEvent {
@@ -35,7 +34,7 @@ describe(UnpatchDirective.name, () => {
3534

3635
beforeEach(() => {
3736
TestBed.configureTestingModule({
38-
imports: [UnpatchModule],
37+
imports: [UnpatchDirective],
3938
declarations: [TestComponent],
4039
teardown: { destroyAfterEach: true },
4140
});

libs/template/unpatch/src/lib/unpatch.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function unpatchEventListener(
117117
*
118118
* @publicApi
119119
*/
120-
@Directive({ selector: '[unpatch]' })
120+
@Directive({ selector: '[unpatch]', standalone: true })
121121
/**
122122
* @todo: add prefix [rxUnpatch]
123123
*/

libs/template/unpatch/src/lib/unpatch.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { NgModule } from '@angular/core';
22

33
import { UnpatchDirective } from './unpatch.directive';
44

5+
/** @deprecated use the standalone import, will be removed with v16 */
56
@NgModule({
6-
declarations: [UnpatchDirective],
7+
imports: [UnpatchDirective],
78
exports: [UnpatchDirective],
89
})
910
export class UnpatchModule {}

0 commit comments

Comments
 (0)