Skip to content

Commit 15b6e5e

Browse files
committed
chore(deps): update ngx-markdown to version 21.0.1 and related dependencies
refactor: simplify imports in example components and update validation error handling
1 parent 6537df7 commit 15b6e5e

File tree

7 files changed

+40
-26
lines changed

7 files changed

+40
-26
lines changed

package-lock.json

Lines changed: 28 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@angular/router": "^21.0.3",
2424
"@tailwindcss/postcss": "^4.1.3",
2525
"clipboard": "^2.0.11",
26-
"ngx-markdown": "^20.1.0",
26+
"ngx-markdown": "^21.0.1",
2727
"postcss": "^8.5.3",
2828
"rxjs": "~7.8.0",
2929
"tailwindcss": "^4.1.3",

src/app/examples/signal-form/example3/example3.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, effect, signal } from '@angular/core';
2-
import { form, required, email, minLength, pattern, schema, Field, FieldPath, validate, customError, FieldValidator, PathKind } from '@angular/forms/signals';
2+
import { form, required, email, minLength, pattern, schema, Field, validate, customError, FieldValidator, PathKind } from '@angular/forms/signals';
33
import { MatButtonModule } from '@angular/material/button';
44
import { MatTabsModule } from '@angular/material/tabs';
55
import { MatCardModule } from '@angular/material/card';

src/app/examples/signal-form/example4/example4.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, effect, signal } from '@angular/core';
2-
import { form, required, email, minLength, pattern, schema, Field, FieldPath, validate, customError, applyEach, validateTree } from '@angular/forms/signals';
2+
import { form, required, schema, Field, applyEach } from '@angular/forms/signals';
33
import { MatButtonModule } from '@angular/material/button';
44
import { MatTabsModule } from '@angular/material/tabs';
55
import { MatCardModule } from '@angular/material/card';

src/app/examples/signal-form/example6/example6.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ const userProjectsSchema = schema<UserProjects>((f) => {
3636
required(project.deadline, { message: 'Deadline is required' });
3737
required(project.status, { message: 'Status is required' });
3838

39-
validateTree(project.deadline, ({ value, fieldOf }) => {
39+
validateTree(project.deadline, ({ value, fieldTreeOf }) => {
4040
const errors: ValidationError[] = [];
4141
const isNotValid = value() && new Date(value()) < new Date();
4242
if (isNotValid) {
43-
errors.push(customError({ kind: 'deadlinePast', field: fieldOf(project.deadline), message: 'Deadline must be in the future' }));
43+
errors.push(customError({ kind: 'deadlinePast', field: fieldTreeOf(project.deadline), message: 'Deadline must be in the future' }));
4444
}
4545
return errors;
4646
});
@@ -51,11 +51,11 @@ const userProjectsSchema = schema<UserProjects>((f) => {
5151
minLength(task.title, 2, { message: 'Task title must be at least 2 characters' });
5252
required(task.priority, { message: 'Priority is required' });
5353
required(task.dueDate, { message: 'Due date is required' });
54-
validateTree(task.dueDate, ({ value, fieldOf }) => {
54+
validateTree(task.dueDate, ({ value, fieldTreeOf }) => {
5555
const errors: ValidationError[] = [];
5656
const isNotValid = value() && new Date(value()) < new Date();
5757
if (isNotValid) {
58-
errors.push(customError({ kind: 'dueDatePast', field: fieldOf(task.dueDate), message: 'Due date must be in the future' }));
58+
errors.push(customError({ kind: 'dueDatePast', field: fieldTreeOf(task.dueDate), message: 'Due date must be in the future' }));
5959
}
6060
return errors;
6161
});

src/assets/examples/signal-forms/example6/example6.component.ts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ const userProjectsSchema = schema<UserProjects>((f) => {
3333
minLength(project.name, 3, { message: 'Project name must be at least 3 characters' });
3434
required(project.deadline, { message: 'Deadline is required' });
3535
required(project.status, { message: 'Status is required' });
36-
validateTree(project.deadline, ({ value, fieldOf }) => {
36+
validateTree(project.deadline, ({ value, fieldTreeOf }) => {
3737
const errors: ValidationError[] = [];
3838
const isNotValid = value() && new Date(value()) < new Date();
3939
if (isNotValid) {
40-
errors.push(customError({ kind: 'deadlinePast', field: fieldOf(project.deadline), message: 'Deadline must be in the future' }));
40+
errors.push(customError({ kind: 'deadlinePast', field: fieldTreeOf(project.deadline), message: 'Deadline must be in the future' }));
4141
}
4242
return errors;
4343
});
@@ -46,11 +46,11 @@ const userProjectsSchema = schema<UserProjects>((f) => {
4646
minLength(task.title, 2, { message: 'Task title must be at least 2 characters' });
4747
required(task.priority, { message: 'Priority is required' });
4848
required(task.dueDate, { message: 'Due date is required' });
49-
validateTree(task.dueDate, ({ value, fieldOf }) => {
49+
validateTree(task.dueDate, ({ value, fieldTreeOf }) => {
5050
const errors: ValidationError[] = [];
5151
const isNotValid = value() && new Date(value()) < new Date();
5252
if (isNotValid) {
53-
errors.push(customError({ kind: 'dueDatePast', field: fieldOf(task.dueDate), message: 'Due date must be in the future' }));
53+
errors.push(customError({ kind: 'dueDatePast', field: fieldTreeOf(task.dueDate), message: 'Due date must be in the future' }));
5454
}
5555
return errors;
5656
});

src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { bootstrapApplication } from '@angular/platform-browser';
22
import { AppComponent } from './app/app.component';
33
import { provideRouter, withPreloading } from '@angular/router';
44
import { ROUTES } from './app-routings';
5-
import { provideZoneChangeDetection, SecurityContext } from '@angular/core';
5+
import { provideZoneChangeDetection } from '@angular/core';
66
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
77
import { CLIPBOARD_OPTIONS, provideMarkdown } from 'ngx-markdown';
88
import { HttpClient, provideHttpClient, withInterceptors } from '@angular/common/http';
@@ -20,7 +20,6 @@ bootstrapApplication(AppComponent, {
2020
provideZoneChangeDetection(),
2121
provideAnimationsAsync(),
2222
provideMarkdown({
23-
sanitize: SecurityContext.NONE,
2423
loader: HttpClient,
2524
clipboardOptions: {
2625
provide: CLIPBOARD_OPTIONS,

0 commit comments

Comments
 (0)