import {Component, Input, OnInit,EventEmitter,Output} from '@angular/core'; @Component({ selector: 'hudongba-detail-time-attr', templateUrl: './detail-time-attr.component.html', styleUrls: ['./detail-time-attr.component.scss'] }) export class DetailTimeAttrComponent implements OnInit { @Input() time: string; @Input() money: string; @Input() address: string; @Input() address2: string; @Input() num: number; @Input() max: number; @Output() onAddr: EventEmitter = new EventEmitter() constructor() { this.time = '04-26 12:30 至 04-26 17:00'; this.money = '¥99~160'; this.address = '朝阳区东三环中路16号京粮大厦4层(北京•方糖小镇)'; this.num = 15; this.max = 70; } ngOnInit() { } _onAddr(){ this.onAddr.emit('open addr'); } }