Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(abc:let): will be removed in v19 #1814

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/abc/let/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ title: let
subtitle: Let
cols: 1
module: import { LetModule } from '@delon/abc/let';
deprecated: 19.0.0
---

# Will be removed in v19, Please use `@let` instead.

Allows to reuse computed value in several places in template to avoid recalculations of getters or many `async` pipes.

```html
Expand Down
3 changes: 3 additions & 0 deletions packages/abc/let/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ title: let
subtitle: 定义
cols: 1
module: import { LetModule } from '@delon/abc/let';
deprecated: 19.0.0
---

# Will be removed in v19, Please use `@let` instead.

允许在模板内复用计算值(包含异步),避免重复重新计算。

```html
Expand Down
3 changes: 3 additions & 0 deletions packages/abc/let/let.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { NzSafeAny } from 'ng-zorro-antd/core/types';

export class LetContext<T> {
constructor(private readonly dir: LetDirective<T>) {}

Check warning on line 6 in packages/abc/let/let.directive.ts

View workflow job for this annotation

GitHub Actions / lint

'LetDirective' is deprecated. Will be removed in v19, Please use `@let` instead

get $implicit(): T {
return this.dir.let;
Expand All @@ -14,6 +14,9 @@
}
}

/**
* @deprecated Will be removed in v19, Please use `@let` instead.
*/
@Directive({ selector: '[let]', standalone: true })
export class LetDirective<T> {
@Input({ required: true }) let!: T;
Expand All @@ -22,7 +25,7 @@
vc.createEmbeddedView(ref, new LetContext<T>(this));
}

static ngTemplateContextGuard<T>(_dir: LetDirective<T>, _ctx: NzSafeAny): _ctx is LetDirective<T> {

Check warning on line 28 in packages/abc/let/let.directive.ts

View workflow job for this annotation

GitHub Actions / lint

'LetDirective' is deprecated. Will be removed in v19, Please use `@let` instead

Check warning on line 28 in packages/abc/let/let.directive.ts

View workflow job for this annotation

GitHub Actions / lint

'LetDirective' is deprecated. Will be removed in v19, Please use `@let` instead
return true;
}
}
3 changes: 3 additions & 0 deletions packages/abc/let/let.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

import { LetDirective } from './let.directive';

const DIRECTIVES = [LetDirective];

Check warning on line 5 in packages/abc/let/let.module.ts

View workflow job for this annotation

GitHub Actions / lint

'LetDirective' is deprecated. Will be removed in v19, Please use `@let` instead

/**
* @deprecated Will be removed in v19, Please use `@let` instead.
*/
@NgModule({
imports: DIRECTIVES,
exports: DIRECTIVES
Expand Down
Loading