Whenever I run this command ng generate @angular/material:navigation dashboard
the terminal shows this
The 'path' option in '__\Desktop\machine test\employee\node_modules@angular\material\schematics\ng-generate\navigation\schema.json' is using deprecated behaviour. 'workingDirectory' smart default provider should be used instead.(0 , validation_1.validateName) is not a function
Is there another way to implement schematics in my project...:)
I tried this:
"$default": {
"$source": "projectName"
}
in path of schema.json
Deprecated behavior problem solved but the 'validation is not a function' still remains.
I'm making an assumption that the version of
@angular-devkit/schematics-cli
you're using is a newer version than the version of@angular/materials
you're using, which is why you're seeing this message.Previously when defining the "path" property in a schematic you would do the following in the
schema.json
for the schematic definition:When the schematic was run if no "path" arg was supplied a default would be correctly set.
This can be seen in the 13.0.x version the the angular material dashboard schematic
As the error suggests (although unless you know schematics it's admittedly not very helpful) the "path" definition needed to be updated to:
As can be seen in the 14.0.x version the the angular material dashboard schematic
"workingDirectory"
as the error suggests is a 'smart default provider' that sets the default value of the path."projectName"
is also a 'smart default provider' but it sets the default value as the project name, not the current path.