Not able to handle nested folder structure for namespaces
See original GitHub issueSupport Request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:
Current behavior
Lazy loading module
AccountModule.ts
@NgModule({
declarations: [AccountCComponent,AccountPComponent],
imports: [
CommonModule,
AccountRoutingModule,
MaterialModule,
FormsModule,
ReactiveFormsModule,
FormElementsModule,
DirectivesModule,
TranslocoModule
],
providers: [{ provide: TRANSLOCO_SCOPE, useValue: { scope: 'master-services/temp-account', alias: 'account' } }],
entryComponents: [AccountPComponent]
})
transloco.loader.ts
import { HttpClient } from '@angular/common/http';
import { Translation, TRANSLOCO_LOADER, TranslocoLoader } from '@ngneat/transloco';
import { Injectable } from '@angular/core';
@Injectable({ providedIn: 'root' })
export class HttpLoader implements TranslocoLoader {
constructor(private http: HttpClient) {}
getTranslation(langPath: string) {
console.log(langPath);
return this.http.get<Translation>(`/assets/i18n/${langPath}.json`);
}
}
export const translocoLoader = { provide: TRANSLOCO_LOADER, useClass: HttpLoader };
output of console.log(langPath) is “[object Object]/ar”
Expected behavior
output of console.log(langPath) is “master-services/temp-account/ar”
What is the motivation / use case for changing the behavior?
Need to use nested folder structure
Environment
Angular version: 7
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [X] Firefox version 70.0b11
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Namespaces and folder structures in c# solutions: how should ...
I use the flat approach. I find a nested hierarchy too hard to maintain. I group my projects into several solutions, with maximum ......
Read more >Matching namespaces to folders is an anti-pattern - Medium
In many languages and development environments, it is common to use the same names for folders that you do for namespaces.
Read more >maintain nested structure when replicating artifacts #12890
If I have a project with a nested folder structure (e.g. my-project/foo/bar ) and I replicate the contents of that project, I would...
Read more >Cannot create nested network namespace - Server Fault
1 Answer 1 · process: that's the main method, and most of the time that's how the namespace is used at all ·...
Read more >Namespaces and File Structure - LearnHowToProgram.com
Let's refactor our code and address the proper file structure for a C# application. ... but specifically does not import nested namespaces.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It worked Thanks a lot itayod
Could you try update to the newest? Until version 2.1.0 we didn’t accept object as scope value