Browse Source
Merge pull request #15635 from abpframework/fix-cli-angular-module-adding-
Cli: Include company name in app.module.ts when adding angular source code
pull/15655/head
Yunus Emre Kalkan
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
1 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs
|
|
|
@ -267,7 +267,15 @@ public class AngularSourceCodeAdder : ITransientDependency |
|
|
|
|
|
|
|
var fileContent = File.ReadAllText(filePath); |
|
|
|
|
|
|
|
fileContent = "import { "+moduleName.Split(".").Last()+"ConfigModule } from '@"+moduleName.Split(".").Last().ToKebabCase()+"/config';" + Environment.NewLine + fileContent; |
|
|
|
var moduleNameAsConfigPath = moduleName.ToKebabCase(); |
|
|
|
|
|
|
|
if (moduleName.Contains(".")) |
|
|
|
{ |
|
|
|
var moduleNameSplited = moduleName.Split("."); |
|
|
|
moduleNameAsConfigPath = moduleNameSplited.Take(moduleNameSplited.Length-1).JoinAsString(".").ToKebabCase() + "/" + moduleNameSplited.Last().ToKebabCase(); |
|
|
|
} |
|
|
|
|
|
|
|
fileContent = "import { "+moduleName.Split(".").Last()+"ConfigModule } from '@"+moduleNameAsConfigPath+"/config';" + Environment.NewLine + fileContent; |
|
|
|
|
|
|
|
fileContent = Regex.Replace(fileContent, "imports\\s*:\\s*\\[", |
|
|
|
"imports: ["+ Environment.NewLine + |
|
|
|
|