Skip to content

Commit

Permalink
fix: Add items as second argument to pipe, for full translate (#23, #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
EndyKaufman committed Mar 7, 2019
1 parent 13bef35 commit 5c3025e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Expand Up @@ -24,7 +24,7 @@
<ng-template
#defaultGridCellTranslatedContent
let-ctx>
{{(ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name])|customTranslate}}
{{(ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name])|customTranslate:ctx.field}}
</ng-template>
<ng-template
#defaultGridCellActionContent
Expand Down
Expand Up @@ -10,7 +10,7 @@
<ion-select-option
*ngFor="let item of items; trackBy: trackByFn;"
[value]="item.id">
{{item[titleField]}}
{{item[titleField] | customTranslate:item}}
</ion-select-option>
</ion-select>
</ng-container>
Expand Up @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { DirectivesModule } from '@rucken/core';
import { DirectivesModule, PipesModule } from '@rucken/core';
import { SelectInputComponent } from './select-input.component';

@NgModule({
Expand All @@ -13,6 +13,7 @@ import { SelectInputComponent } from './select-input.component';
FormsModule,
ReactiveFormsModule,
DirectivesModule,
PipesModule,
TranslateModule.forChild(),
],
declarations: [SelectInputComponent],
Expand Down
Expand Up @@ -17,6 +17,6 @@
{{ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name]}}
</ng-container>
<ng-container *ngIf="ctx.field.name==='permissions' && ctx.item[ctx.field.name].length">
{{'Permissions'|customTranslate}}: {{ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name]}}
{{'Permissions'|customTranslate:ctx.field}}: {{ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name]}}
</ng-container>
</ng-template>
Expand Up @@ -16,6 +16,6 @@
{{ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name]}}
</ng-container>
<ng-container *ngIf="ctx.field.name==='groups' && ctx.item[ctx.field.name].length">
{{'Groups'|customTranslate}}: {{ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name]}}
{{'Groups'|customTranslate:ctx.field}}: {{ctx.item[ctx.field.name+'AsString'] || ctx.item[ctx.field.name]}}
</ng-container>
</ng-template>

0 comments on commit 5c3025e

Please sign in to comment.