Skip to content

Upgrade from 1.0.0 beta.8.1 to 1.0.0.rc.0

Jeremy Smartt edited this page Nov 15, 2017 · 12 revisions
  • Update package.json dependencies
  • In app.module.ts add registerLocaleData(localeEs); for translations
  • In any *spec.ts files add registerLocaleData(localeEs); for translations
  • If using flex on an input field and want it to go below 180 px add this style:
/deep/ .mat-input-infix.mat-form-field-infix {
  width: 100%;
} 
  • Add test.ts to "includes" in src/tsconfig.spec.json:
"include": [
   "test.ts",
   "**/*.spec.*"
]
  • Use HttpClient for ngx-translate

app.module.ts

import { HttpClientModule, HttpClient } from '@angular/common/http';
...
imports: [
HttpClientModule
]
...
loader: {
          provide: TranslateLoader,
          useFactory: createTranslateLoader,
          deps: [HttpClient],

translate.ts

...
import { HttpClient } from '@angular/common/http';
...
export function createTranslateLoader(httpClient: HttpClient): TranslateLoader {
 return new TranslateHttpLoader(httpClient, 'assets/i18n/', '.json');
}
  • Change any ngOutletContext to ngTemplateOutletContext
  • Add to index.html to use standard Roboto font:
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
  • For e2e tests make sure to upgrade ts-node in package.json to 3.1.0. See here: https://github.com/Microsoft/TypeScript/issues/16772
  • For aot builds make sure to upgrade rxjs in package.json to 5.5.2
  • For aot builds to avoid out of heap space errors add to the package.json the following scripts to build or server aot that increase the max_old_space_size. Use these scripts for any aot builds in Docker or Jenkins or anywhere needed:
"scripts": {
    "build:prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --aot --prod --sourcemap=false --build-optimizer",
    "serve:prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng serve --aot --prod --sourcemap=false --build-optimizer",