Browse Source
Merge pull request #19349 from abpframework/sinan/module-path
Update route path to kebab-case while adding module or source code
pull/19375/head
Masum ULU
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
2 additions and
2 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
|
|
|
@ -309,7 +309,7 @@ public class AngularSourceCodeAdder : ITransientDependency |
|
|
|
string pattern = "Routes\\s*=\\s*\\["; |
|
|
|
string newContent = $@"Routes = [
|
|
|
|
{{ |
|
|
|
path: '{path}', |
|
|
|
path: '{path.ToKebabCase()}', |
|
|
|
loadChildren: () => import('@{moduleNameAsConfigPath}') |
|
|
|
.then(m => m.{(moduleName.Split(".").Length > 1 ? moduleName.Split(".")[1] : moduleName)}Module.forLazy()) |
|
|
|
}}, |
|
|
|
|
|
|
|
@ -234,7 +234,7 @@ public class SolutionModuleAdder : ITransientDependency |
|
|
|
appRoutingModuleFileContent = Regex.Replace(appRoutingModuleFileContent, "Routes\\s*=\\s*\\[", |
|
|
|
"Routes = [" + Environment.NewLine + |
|
|
|
" " + "{" + Environment.NewLine + |
|
|
|
" " + "path: '" + moduleName.ToLower() + "'," + Environment.NewLine + |
|
|
|
" " + "path: '" + moduleName.ToKebabCase() + "'," + Environment.NewLine + |
|
|
|
" " + "loadChildren: () => " + $"import('{angularPackage.Name.EnsureStartsWith('@')}').then(m => m.{moduleName}Module.forLazy())," + Environment.NewLine + |
|
|
|
" " + "},"); |
|
|
|
} |
|
|
|
|