8000 Unable to get property 'KEY' of undefined or null reference · Issue #74 · ngx-translate/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Unable to get property 'KEY' of undefined or null reference #74
Closed
@shmu80

Description

@shmu80

I am implement ng2-translate into Ionic 2 project. At first, I am having build error. After I modify some variable declare to the code below, it has no issue during project build.

@App({
  templateUrl: 'build/app.html',
  config: {}, // http://ionicframework.com/docs/v2/api/config/Config/
  providers: [
    provide(TranslateLoader, {
      useFactory: (http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'),
      deps: [[Http]]
    }),
    TranslateService
  ],
  pipes: [TranslatePipe]
})

Anyway, I am having property undefined issue now.

EXCEPTION: TypeError: Unable to get property 'title' of undefined or null reference in [ {{ "title" | translate }} in AccessPage@7:13

Below is my access page code

    <ion-navbar *navbar>
      <ion-title> {{ "title" | translate }} </ion-title>
    </ion-navbar>

and my code in en.json.

    {
    "title" : "Testing",
    }

so I am wondering the problem is because it couldn't find the en.json (located at www/assets/i18n folder) or some other issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0