Skip to content

Commit

Permalink
Merge branch 'master' into update-licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharkazaz committed Aug 7, 2020
2 parents 624b943 + 6cb62c0 commit a46eb58
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@
"contributions": [
"code"
]
},
{
"login": "karmasakshi",
"name": "Karmasakshi Goyal",
"avatar_url": "https://avatars3.githubusercontent.com/u/4698762?v=4",
"profile": "https://github.com/karmasakshi",
"contributions": [
"tool"
]
}
],
"contributorsPerLine": 7
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/StillUpgrade"><img src="https://avatars0.githubusercontent.com/u/10169092?v=4" width="100px;" alt=""/><br /><sub><b>StillUpgrade</b></sub></a><br /><a href="https://github.com/ngneat/transloco/commits?author=StillUpgrade" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/coderunner"><img src="https://avatars0.githubusercontent.com/u/408380?v=4" width="100px;" alt=""/><br /><sub><b>Felix Trepanier</b></sub></a><br /><a href="https://github.com/ngneat/transloco/commits?author=coderunner" title="Code">💻</a></td>
<td align="center"><a href="http://literalpie.com"><img src="https://avatars1.githubusercontent.com/u/20398475?v=4" width="100px;" alt=""/><br /><sub><b>Benjamin Kindle</b></sub></a><br /><a href="https://github.com/ngneat/transloco/commits?author=literalpie" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/karmasakshi"><img src="https://avatars3.githubusercontent.com/u/4698762?v=4" width="100px;" alt=""/><br /><sub><b>Karmasakshi Goyal</b></sub></a><br /><a href="#tool-karmasakshi" title="Tools">🔧</a></td>
</tr>
</table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TranslocoModule
} from '@ngneat/transloco';
import { Injectable, NgModule } from '@angular/core';
<% if (importEnv) {%>import { environment } from '../environments/environment';<% } %>
<% if (importEnv) {%>import { environment } from '../../environments/environment';<% } %>

@Injectable({ providedIn: 'root' })
export class TranslocoHttpLoader implements TranslocoLoader {
Expand Down
12 changes: 6 additions & 6 deletions schematics/src/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { findRootModule } from '../utils/find-module';
import { getProject, setEnvironments } from '../utils/projects';
import { checkIfTranslationFilesExist } from '../utils/translations';
import { createConfig } from '../utils/transloco';
import {SchemaOptions, Loaders} from './schema';
import { SchemaOptions, Loaders } from './schema';

function jsonTranslationFileCreator(source, lang) {
return source.create(
Expand Down Expand Up @@ -127,7 +127,7 @@ export default function(options: SchemaOptions): Rule {
const translateFiles = apply(source(createTranslateFiles(langs, translationCreator)), [move('/', assetsPath)]);

options.module = findRootModule(host, options.module, sourceRoot) as string;
const modulePath = options.module.substring(0, options.module.lastIndexOf('/') + 1);
const modulePath = options.module.substring(0, options.module.lastIndexOf('/') + 1) + 'transloco/';

if (options.ssr) {
updateEnvironmentBaseUrl(host, sourceRoot, 'http://localhost:4200');
Expand All @@ -138,13 +138,13 @@ export default function(options: SchemaOptions): Rule {
return chain([
options.loader === Loaders.Http
? chain([
addImportsToModuleFile(options, ['HttpClientModule'], '@angular/common/http'),
addImportsToModuleDeclaration(options, ['HttpClientModule'])
])
addImportsToModuleFile(options, ['HttpClientModule'], '@angular/common/http'),
addImportsToModuleDeclaration(options, ['HttpClientModule'])
])
: noop(),
checkIfTranslationFilesExist(assetsPath, langs, '.json', true) ? noop() : mergeWith(translateFiles),
mergeWith(createTranslocoModule(isLib, options.ssr, langs, modulePath)),
addImportsToModuleFile(options, ['TranslocoRootModule'], './transloco-root.module'),
addImportsToModuleFile(options, ['TranslocoRootModule'], './transloco/transloco-root.module'),
addImportsToModuleDeclaration(options, ['TranslocoRootModule'])
])(host, context);
};
Expand Down

0 comments on commit a46eb58

Please sign in to comment.