<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x ] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x ] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto">I'm in the process of incrementally upgrading an ng1 app to ng2. I'm getting this error when I try and use a downgraded service</p>
<p dir="auto">app.module.ts</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { BrowserModule } from '@angular/platform-browser';
import { GlobalVariables } from './global/config/variables';

@NgModule({
  imports: [ BrowserModule ],
  declarations: [    ],
  bootstrap:    [ ],
  providers: [ GlobalVariables ],
})

export class AppModule { }"><pre class="notranslate"><code class="notranslate">import { BrowserModule } from '@angular/platform-browser';
import { GlobalVariables } from './global/config/variables';

@NgModule({
  imports: [ BrowserModule ],
  declarations: [    ],
  bootstrap:    [ ],
  providers: [ GlobalVariables ],
})

export class AppModule { }
</code></pre></div>
<p dir="auto">entry.ts</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import '../styles/fonts/circular-black.css';
import '../styles/fonts/circular-book.css';
import '../styles/fonts/din-bold.css';
import '../styles/fonts/din-regular.css';
import '../styles/fonts/futura-medium.css';
import '../styles/styles.css';
import '../styles/themes.css';

import './app';
import './lb-services.js';

import './global/config/variables';
import './global/config/router-config';
import './global/config/theme-config';
import './global/components/browser-frame';
import './global/components/login';
import './global/components/scenario-login';
import './global/components/scenarios';
import './global/directives/demo-popup';
import './global/directives/pdf-popup';
import './global/services/auth';
import './global/services/awaiting-response';
import './global/services/clients';
import './global/services/transactions';
import './global/services/transfers';

import './banking-module/index-component';
import './banking-module/account-total';
import './banking-module/dashboard';
import './banking-module/payee';
import './banking-module/transaction';
import './banking-module/transactions';
import './banking-module/transfer';
import './banking-module/transfer-confirm';

import './compliance-module/index-component';
import './compliance-module/dashboard';
import './compliance-module/history';
import './compliance-module/transfer';
import './compliance-module/transfers';

import './token-module/token-inspector';
import './token-module/token-inspector-redux';
import './token-module/tokens-service';

// Must be after all the requirements for the app.ts
import './upgrade-adapter';"><pre class="notranslate"><code class="notranslate">import '../styles/fonts/circular-black.css';
import '../styles/fonts/circular-book.css';
import '../styles/fonts/din-bold.css';
import '../styles/fonts/din-regular.css';
import '../styles/fonts/futura-medium.css';
import '../styles/styles.css';
import '../styles/themes.css';

import './app';
import './lb-services.js';

import './global/config/variables';
import './global/config/router-config';
import './global/config/theme-config';
import './global/components/browser-frame';
import './global/components/login';
import './global/components/scenario-login';
import './global/components/scenarios';
import './global/directives/demo-popup';
import './global/directives/pdf-popup';
import './global/services/auth';
import './global/services/awaiting-response';
import './global/services/clients';
import './global/services/transactions';
import './global/services/transfers';

import './banking-module/index-component';
import './banking-module/account-total';
import './banking-module/dashboard';
import './banking-module/payee';
import './banking-module/transaction';
import './banking-module/transactions';
import './banking-module/transfer';
import './banking-module/transfer-confirm';

import './compliance-module/index-component';
import './compliance-module/dashboard';
import './compliance-module/history';
import './compliance-module/transfer';
import './compliance-module/transfers';

import './token-module/token-inspector';
import './token-module/token-inspector-redux';
import './token-module/tokens-service';

// Must be after all the requirements for the app.ts
import './upgrade-adapter';
</code></pre></div>
<p dir="auto">upgrade-adapter.ts</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { UpgradeAdapter } from '@angular/upgrade';
import { AppModule } from './app.module';
import { GlobalVariables } from './global/config/variables';

let adapter = new UpgradeAdapter(AppModule);
angular
    .module('app')
    .service('globalVars', adapter.downgradeNg2Provider(GlobalVariables));

adapter.bootstrap(document.documentElement, ['app']);"><pre class="notranslate"><code class="notranslate">import { UpgradeAdapter } from '@angular/upgrade';
import { AppModule } from './app.module';
import { GlobalVariables } from './global/config/variables';

let adapter = new UpgradeAdapter(AppModule);
angular
    .module('app')
    .service('globalVars', adapter.downgradeNg2Provider(GlobalVariables));

adapter.bootstrap(document.documentElement, ['app']);
</code></pre></div>
<p dir="auto">global/config/variables.ts</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { Injectable } from '@angular/core';

@Injectable()

export class GlobalVariables
{
    currentUser:any
    ROLES = {
      COMPLIANCE:'compliance',
      CONSUMER:'consumer'
    }
    BANKS = {
      REMITTER:{
        name: 'Thai Bank',
        key: 'alpha',
        realm: 'alpha-business'
      },
      RECEIVER:{
        name: 'American Mutual',
        key: 'beta',
        realm: 'beta-business'
      }
    }
    CUSTOMERS = {
      REMITTER: {
        accountName: 'Armstrong Pty Ltd',
        postalAddress: '1031 Ploenchit road, Pathumwan, 10330 Central Embassy, Lumphini, Pathum Wan',
        postcode: 'Bangkok 10330',
        country: 'Thailand',
        realm: 'alpha-client'
      },
      RECEIVER: {
        accountName: 'USASolar LLC',
        postalAddress: 'One Times Square, New York',
        postcode: 'NY 10036',
        country: 'United States',
        realm: 'beta-client'
      }
    }
    themes = [
      {scenario:'Originator Client',
        logo: null,
        webAddress: 'www.thai-bank.com',
        displayEmail: 'jhon-doe@hotmail.com',
        realm: this.CUSTOMERS.REMITTER.realm,
        tabTitle: this.BANKS.REMITTER.name+' - Online',
        institution: this.BANKS.REMITTER.name,
        name: this.BANKS.REMITTER.key,
        role: this.ROLES.CONSUMER},
      {scenario:'Originator Operator',
        logo: null,
        webAddress: 'compliance.thai-bank.com',
        displayEmail: 'nancy@thai-bank.com',
        realm: this.BANKS.REMITTER.realm,
        tabTitle: this.BANKS.REMITTER.name+' - Compliance',
        institution: this.BANKS.REMITTER.name,
        name: this.BANKS.REMITTER.key,
        role: this.ROLES.COMPLIANCE},
      {scenario:'Beneficiary Operator',
        logo: 'noun_123964_cc',
        webAddress: 'compliance.american-mutual.com',
        displayEmail: 'jimmy@american-mutual.com',
        realm: this.BANKS.RECEIVER.realm,
        tabTitle: this.BANKS.RECEIVER.name+' - Compliance',
        institution: this.BANKS.RECEIVER.name,
        name: this.BANKS.RECEIVER.key,
        role: this.ROLES.COMPLIANCE},
      {scenario:'Beneficiary Client',
        logo: 'noun_123964_cc',
        webAddress: 'www.american-mutual.com',
        displayEmail: 'thomas-eliot@usa-solar.com',
        realm: this.CUSTOMERS.RECEIVER.realm,
        tabTitle: this.BANKS.RECEIVER.name+' - Online',
        institution: this.BANKS.RECEIVER.name,
        name: this.BANKS.RECEIVER.key,
        role: this.ROLES.CONSUMER}
    ]
    theming = {
      themes:this.themes,
      current:null
    }
    setCurrentTheme:(theme:any)=&gt;void
    constructor(private window: Window){
      function sessionCacheSet(key:string, object:any){
        window.sessionStorage.setItem(key, angular.toJson(object));
      }

      function sessionCacheGet(key:string, defVal:any){
        try {
          return angular.fromJson(window.sessionStorage.getItem(key));
        }
        catch(e){
          return defVal;
        }
      }

      this.theming.current =  sessionCacheGet('current-theme', this.themes[0]);
      this.setCurrentTheme = (theme) =&gt; {
        this.theming.current = theme;
      }
    }
}

import { UpgradeAdapter } from '@angular/upgrade';
import { AppModule } from '../../app.module';

let adapter = new UpgradeAdapter(AppModule);

angular
    .module('app')
    .service('globalVars', adapter.downgradeNg2Provider(GlobalVariables));"><pre class="notranslate"><code class="notranslate">import { Injectable } from '@angular/core';

@Injectable()

export class GlobalVariables
{
    currentUser:any
    ROLES = {
      COMPLIANCE:'compliance',
      CONSUMER:'consumer'
    }
    BANKS = {
      REMITTER:{
        name: 'Thai Bank',
        key: 'alpha',
        realm: 'alpha-business'
      },
      RECEIVER:{
        name: 'American Mutual',
        key: 'beta',
        realm: 'beta-business'
      }
    }
    CUSTOMERS = {
      REMITTER: {
        accountName: 'Armstrong Pty Ltd',
        postalAddress: '1031 Ploenchit road, Pathumwan, 10330 Central Embassy, Lumphini, Pathum Wan',
        postcode: 'Bangkok 10330',
        country: 'Thailand',
        realm: 'alpha-client'
      },
      RECEIVER: {
        accountName: 'USASolar LLC',
        postalAddress: 'One Times Square, New York',
        postcode: 'NY 10036',
        country: 'United States',
        realm: 'beta-client'
      }
    }
    themes = [
      {scenario:'Originator Client',
        logo: null,
        webAddress: 'www.thai-bank.com',
        displayEmail: 'jhon-doe@hotmail.com',
        realm: this.CUSTOMERS.REMITTER.realm,
        tabTitle: this.BANKS.REMITTER.name+' - Online',
        institution: this.BANKS.REMITTER.name,
        name: this.BANKS.REMITTER.key,
        role: this.ROLES.CONSUMER},
      {scenario:'Originator Operator',
        logo: null,
        webAddress: 'compliance.thai-bank.com',
        displayEmail: 'nancy@thai-bank.com',
        realm: this.BANKS.REMITTER.realm,
        tabTitle: this.BANKS.REMITTER.name+' - Compliance',
        institution: this.BANKS.REMITTER.name,
        name: this.BANKS.REMITTER.key,
        role: this.ROLES.COMPLIANCE},
      {scenario:'Beneficiary Operator',
        logo: 'noun_123964_cc',
        webAddress: 'compliance.american-mutual.com',
        displayEmail: 'jimmy@american-mutual.com',
        realm: this.BANKS.RECEIVER.realm,
        tabTitle: this.BANKS.RECEIVER.name+' - Compliance',
        institution: this.BANKS.RECEIVER.name,
        name: this.BANKS.RECEIVER.key,
        role: this.ROLES.COMPLIANCE},
      {scenario:'Beneficiary Client',
        logo: 'noun_123964_cc',
        webAddress: 'www.american-mutual.com',
        displayEmail: 'thomas-eliot@usa-solar.com',
        realm: this.CUSTOMERS.RECEIVER.realm,
        tabTitle: this.BANKS.RECEIVER.name+' - Online',
        institution: this.BANKS.RECEIVER.name,
        name: this.BANKS.RECEIVER.key,
        role: this.ROLES.CONSUMER}
    ]
    theming = {
      themes:this.themes,
      current:null
    }
    setCurrentTheme:(theme:any)=&gt;void
    constructor(private window: Window){
      function sessionCacheSet(key:string, object:any){
        window.sessionStorage.setItem(key, angular.toJson(object));
      }

      function sessionCacheGet(key:string, defVal:any){
        try {
          return angular.fromJson(window.sessionStorage.getItem(key));
        }
        catch(e){
          return defVal;
        }
      }

      this.theming.current =  sessionCacheGet('current-theme', this.themes[0]);
      this.setCurrentTheme = (theme) =&gt; {
        this.theming.current = theme;
      }
    }
}

import { UpgradeAdapter } from '@angular/upgrade';
import { AppModule } from '../../app.module';

let adapter = new UpgradeAdapter(AppModule);

angular
    .module('app')
    .service('globalVars', adapter.downgradeNg2Provider(GlobalVariables));
</code></pre></div>
<p dir="auto">package.json</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;client&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;main&quot;: &quot;ts/app.ts&quot;,
  &quot;scripts&quot;: {},
  &quot;dependencies&quot;: {
    &quot;angular&quot;: &quot;^1.5.8&quot;,
    &quot;angular-animate&quot;: &quot;^1.5.8&quot;,
    &quot;angular-aria&quot;: &quot;^1.5.8&quot;,
    &quot;angular-cookies&quot;: &quot;^1.5.8&quot;,
    &quot;angular-google-analytics&quot;: &quot;^1.1.7&quot;,
    &quot;angular-material&quot;: &quot;^1.1.1&quot;,
    &quot;angular-material-data-table&quot;: &quot;^0.10.9&quot;,
    &quot;angular-md5&quot;: &quot;^0.1.10&quot;,
    &quot;angular-messages&quot;: &quot;^1.5.8&quot;,
    &quot;angular-resource&quot;: &quot;^1.5.8&quot;,
    &quot;angular-sanitize&quot;: &quot;^1.5.8&quot;,
    &quot;angular-timeline&quot;: &quot;^1.7.0&quot;,
    &quot;angular-ui-router&quot;: &quot;^1.0.0-beta.2&quot;,
    &quot;bootstrap&quot;: &quot;^3.3.7&quot;,
    &quot;jquery&quot;: &quot;^3.1.0&quot;,
    &quot;ng-redux&quot;: &quot;^3.4.0-beta.1&quot;,

    &quot;@angular/common&quot;: &quot;2.0.0&quot;,
    &quot;@angular/compiler&quot;: &quot;2.0.0&quot;,
    &quot;@angular/core&quot;: &quot;2.0.0&quot;,
    &quot;@angular/forms&quot;: &quot;2.0.0&quot;,
    &quot;@angular/http&quot;: &quot;2.0.0&quot;,
    &quot;@angular/platform-browser&quot;: &quot;2.0.0&quot;,
    &quot;@angular/platform-browser-dynamic&quot;: &quot;2.0.0&quot;,
    &quot;@angular/router&quot;: &quot;3.0.0&quot;,
    &quot;@angular/upgrade&quot;: &quot;2.0.0&quot;,
    &quot;core-js&quot;: &quot;^2.4.1&quot;,
    &quot;reflect-metadata&quot;: &quot;^0.1.3&quot;,
    &quot;rxjs&quot;: &quot;5.0.0-beta.12&quot;,
    &quot;systemjs&quot;: &quot;0.19.27&quot;,
    &quot;zone.js&quot;: &quot;^0.6.21&quot;,
    &quot;angular2-in-memory-web-api&quot;: &quot;0.0.20&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;angular-mocks&quot;: &quot;^1.5.8&quot;,
    &quot;css-loader&quot;: &quot;^0.25.0&quot;,
    &quot;css-raw-loader&quot;: &quot;^0.1.1&quot;,
    &quot;expose-loader&quot;: &quot;^0.7.1&quot;,
    &quot;extract-text-webpack-plugin&quot;: &quot;^1.0.1&quot;,
    &quot;file-loader&quot;: &quot;^0.9.0&quot;,
    &quot;html-loader&quot;: &quot;^0.4.4&quot;,
    &quot;html-webpack-plugin&quot;: &quot;^2.22.0&quot;,
    &quot;node-sass&quot;: &quot;^3.9.3&quot;,
    &quot;null-loader&quot;: &quot;^0.1.1&quot;,
    &quot;raw-loader&quot;: &quot;^0.5.1&quot;,
    &quot;sass-loader&quot;: &quot;^4.0.2&quot;,
    &quot;style-loader&quot;: &quot;^0.13.1&quot;,
    &quot;ts-loader&quot;: &quot;^0.8.2&quot;,
    &quot;tsc&quot;: &quot;^1.20150623.0&quot;,
    &quot;typescript&quot;: &quot;^1.8.10&quot;,
    &quot;webpack&quot;: &quot;^1.13.2&quot;
  },
  &quot;repository&quot;: {
    &quot;type&quot;: &quot;&quot;,
    &quot;url&quot;: &quot;&quot;
  },
  &quot;license&quot;: &quot;UNLICENSED&quot;,
  &quot;description&quot;: &quot;Client app&quot;
}"><pre class="notranslate"><code class="notranslate">{
  "name": "client",
  "version": "1.0.0",
  "main": "ts/app.ts",
  "scripts": {},
  "dependencies": {
    "angular": "^1.5.8",
    "angular-animate": "^1.5.8",
    "angular-aria": "^1.5.8",
    "angular-cookies": "^1.5.8",
    "angular-google-analytics": "^1.1.7",
    "angular-material": "^1.1.1",
    "angular-material-data-table": "^0.10.9",
    "angular-md5": "^0.1.10",
    "angular-messages": "^1.5.8",
    "angular-resource": "^1.5.8",
    "angular-sanitize": "^1.5.8",
    "angular-timeline": "^1.7.0",
    "angular-ui-router": "^1.0.0-beta.2",
    "bootstrap": "^3.3.7",
    "jquery": "^3.1.0",
    "ng-redux": "^3.4.0-beta.1",

    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "@angular/upgrade": "2.0.0",
    "core-js": "^2.4.1",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.21",
    "angular2-in-memory-web-api": "0.0.20"
  },
  "devDependencies": {
    "angular-mocks": "^1.5.8",
    "css-loader": "^0.25.0",
    "css-raw-loader": "^0.1.1",
    "expose-loader": "^0.7.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.9.0",
    "html-loader": "^0.4.4",
    "html-webpack-plugin": "^2.22.0",
    "node-sass": "^3.9.3",
    "null-loader": "^0.1.1",
    "raw-loader": "^0.5.1",
    "sass-loader": "^4.0.2",
    "style-loader": "^0.13.1",
    "ts-loader": "^0.8.2",
    "tsc": "^1.20150623.0",
    "typescript": "^1.8.10",
    "webpack": "^1.13.2"
  },
  "repository": {
    "type": "",
    "url": ""
  },
  "license": "UNLICENSED",
  "description": "Client app"
}
</code></pre></div>
<p dir="auto"><strong>Expected behavior</strong><br>
I would expect the app upgradeAdapter to handle this type of service, it's very simple and has only window as a dependency</p>
<p dir="auto"><strong>Reproduction of the problem</strong><br>
Simply trying to bootstrap a ng1/ng2 hybrid app</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
n/a</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
OSX, Visual Studio Code, Webpack, node express</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0</li>
<li><strong>Browser:</strong> [ Chrome ]</li>
<li><strong>Language:</strong> [TypeScript 1.8.10]</li>
</ul>
<p dir="auto">tsconfig</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;compileOnSave&quot;: false,
    &quot;compilerOptions&quot;: {
        &quot;target&quot;: &quot;es5&quot;,
        &quot;module&quot;: &quot;commonjs&quot;,
        &quot;moduleResolution&quot;: &quot;node&quot;,
        &quot;noImplicitAny&quot;: false,
        &quot;removeComments&quot;: true,
        &quot;preserveConstEnums&quot;: true,
        &quot;outDir&quot;: &quot;../www/js&quot;,
        &quot;sourceMap&quot;: true,
        &quot;emitDecoratorMetadata&quot;: true,
        &quot;experimentalDecorators&quot;: true,
        &quot;suppressImplicitAnyIndexErrors&quot;: true
    }
}"><pre class="notranslate"><code class="notranslate">{
    "compileOnSave": false,
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "noImplicitAny": false,
        "removeComments": true,
        "preserveConstEnums": true,
        "outDir": "../www/js",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "suppressImplicitAnyIndexErrors": true
    }
}
</code></pre></div>
<ul dir="auto">
<li><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =   v4.4.7</li>
</ul>
<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ ] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ ] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
Unless I am missing something obvious, it seems like the i18n tool assumes that you are extracting a single i18n file for the entire application.</p>
<p dir="auto">My experience is that this is not an ideal workflow for large multi-team applications. Maintaining a shared file doesn't seem like it will scale.</p>
<p dir="auto"><strong>Desired behavior</strong><br>
It would be very helpful if the tool allowed us to extract the translations into multiple, smaller files that could be pieced together later.</p>
<p dir="auto">e.g.<br>
Allow Team A and Team B to maintain separate files, specific to feature A and Feature B</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
Making it easier for multiple teams to work on larger apps.</p>