Skip to content

Commit

Permalink
Merge pull request #19349 from abpframework/sinan/module-path
Browse files Browse the repository at this point in the history
Update route path to kebab-case while adding module or source code
  • Loading branch information
masumulu28 committed Mar 21, 2024
2 parents 0474eb0 + 46223d4 commit 2f1142f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private async Task AddProjectToAppRoutingTsAsync(string angularPath, string modu
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())
}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private void ConfigureAngularPackagesForAppRoutingModuleFile(string angularPath,
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 +
" " + "},");
}
Expand Down

0 comments on commit 2f1142f

Please sign in to comment.