Skip to content

Commit

Permalink
fix(DI): use static method for Element (#266)
Browse files Browse the repository at this point in the history
fixes webpack related issues
  • Loading branch information
bigopon authored and zewa666 committed Apr 21, 2018
1 parent 0ae50d8 commit 71099bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/base-i18n.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import {I18N} from './i18n';
import {DOM} from 'aurelia-pal';
import {EventAggregator} from 'aurelia-event-aggregator';
import { I18N } from './i18n';
import { DOM } from 'aurelia-pal';
import { EventAggregator } from 'aurelia-event-aggregator';

export class BaseI18N {

static inject = [I18N, DOM.Element, EventAggregator];
static inject() {
return [I18N, DOM.Element, EventAggregator];
}

constructor(i18n, element, ea) {
this.i18n = i18n;
Expand Down
2 changes: 1 addition & 1 deletion src/defaultTranslations/relative.time.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export const translations = {
'year_ago': '__count__ 年前',
'year_ago_plural': '__count__ 年前',
'year_in': 'あと __count__ 年',
'year_in_plural': 'あと __count__ 年'
'year_in_plural': 'あと __count__ 年'
}
},
jp: {
Expand Down
8 changes: 6 additions & 2 deletions src/t.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export class TValueConverter {

@customAttribute('t-params')
export class TParamsCustomAttribute {
static inject = [DOM.Element];
static inject() {
return [DOM.Element];
}
static configureAliases(aliases) {
let r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute);
r.aliases = aliases;
Expand All @@ -40,7 +42,9 @@ export class TParamsCustomAttribute {
@customAttribute('t')
export class TCustomAttribute {

static inject = [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)];
static inject() {
return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)];
}
static configureAliases(aliases) {
let r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute);
r.aliases = aliases;
Expand Down

0 comments on commit 71099bc

Please sign in to comment.