diff --git a/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.spec.ts b/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.spec.ts
index d8339810be04..2b1bf17b7b2b 100644
--- a/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.spec.ts
+++ b/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.spec.ts
@@ -97,19 +97,40 @@ describe('slider template migrator', () => {
);
await runMigrationTest(
`
- `,
+ `,
`
-
-
+
+ `,
+ );
+ await runMigrationTest(
+ `
+ `,
+ `
+
`,
);
await runMigrationTest(
`
- `,
+ `,
`
-
+
+
+ `,
+ );
+ });
+
+ it('should remove displayValue and comment suggesting to switch to displayWith', async () => {
+ await runMigrationTest(
+ `
+ `,
+ `
+
`,
);
});
diff --git a/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.ts b/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.ts
index 702ac5f5aef3..a5e831998f81 100644
--- a/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.ts
+++ b/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.ts
@@ -52,12 +52,25 @@ export class SliderTemplateMigrator extends TemplateMigrator {
updates.push(this._removeBinding(originalHtml, binding.node));
}
- if (binding.name === 'invert' || binding.name === 'vertical') {
+ if (
+ binding.name === 'invert' ||
+ binding.name === 'vertical' ||
+ binding.name === 'tickInterval' ||
+ binding.name === 'valueText'
+ ) {
// Remove the binding and leave a comment.
comments.push(``);
updates.push(this._removeBinding(originalHtml, binding.node));
}
+ if (binding.name === 'displayValue') {
+ // Remove the binding and leave a comment.
+ comments.push(
+ ``,
+ );
+ updates.push(this._removeBinding(originalHtml, binding.node));
+ }
+
// TODO(wagnermaciel): Finish the remapping of other bindings.
}