Browse Source
Merge pull request #15551 from abpframework/issues/15550
Cli: Fix wrong import when module added to angular project
pull/15581/head
Muhammed Altuğ
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs
|
|
@ -267,11 +267,11 @@ public class AngularSourceCodeAdder : ITransientDependency |
|
|
|
|
|
|
|
|
var fileContent = File.ReadAllText(filePath); |
|
|
var fileContent = File.ReadAllText(filePath); |
|
|
|
|
|
|
|
|
fileContent = "import { "+moduleName.Split(".").Last()+"Module } from '@"+moduleName.Split(".").Last().ToKebabCase()+"/config';" + Environment.NewLine + fileContent; |
|
|
fileContent = "import { "+moduleName.Split(".").Last()+"ConfigModule } from '@"+moduleName.Split(".").Last().ToKebabCase()+"/config';" + Environment.NewLine + fileContent; |
|
|
|
|
|
|
|
|
fileContent = Regex.Replace(fileContent, "imports\\s*:\\s*\\[", |
|
|
fileContent = Regex.Replace(fileContent, "imports\\s*:\\s*\\[", |
|
|
"imports: ["+ Environment.NewLine + |
|
|
"imports: ["+ Environment.NewLine + |
|
|
" " + moduleName.Split(".").Last() + "Module.forRoot(),"); |
|
|
" " + moduleName.Split(".").Last() + "ConfigModule.forRoot(),"); |
|
|
|
|
|
|
|
|
File.WriteAllText(filePath, fileContent); |
|
|
File.WriteAllText(filePath, fileContent); |
|
|
} |
|
|
} |
|
|
|