У меня есть файл myapp.component.ts, в котором у меня есть
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { isNullOrUndefined } from 'util';
import { AuthenticationService } from '/services';
import * as _ from 'lodash';
@Component({
selector: 'cd-myapp',
templateUrl: './myapp.component.html',
styleUrls: ['./myapp.component.scss']
})
export class myAppComponent implements OnInit {
@Input() car: Car;
constructor(
private authenticationService: AuthenticationService) { }
ngOnInit() {
//my code
}
}
У меня есть другой компонент, в котором у меня есть следующий файл в файле carhandler.component.ts:
import { Component, OnInit, Input, Output, EventEmitter } from
'@angular/core';
@Component({
selector: 'app-carhandler',
templateUrl: './carhandler.component.html',
styleUrls: ['./carhandler.component.scss']
})
export class CarhandlerComponent implements OnInit {
@Input() field: string;
@Input() value: string;
constructor() { }
ngOnInit() {
}}
В моем myapp.component.html я хотел бы добавить. Я попробовал это:
<app-carhandler [field]="Testing"
[value] = "'DESCRIPTION' | translate" +'-'+{{car.color}}>
</app-carhandler >
Это не работает. Как мне решить эту проблему?