Welcome aboard! We are happy you are here and wish you good net-raft!
// put into app.component.ts
import { Component, OnInit } from '@angular/core';
import { MyserviceService } from './../myservice.service';
@Component({
selector: 'app-new-cmp',
templateUrl: './new-cmp.component.html',
styleUrls: ['./new-cmp.component.css']
})
export class NewCmpComponent implements OnInit {
todaydate;
newcomponent = "your new component";
constructor(private myservice: MyserviceService) {}
ngOnInit() {
this.todaydate = this.myservice.showTodayDate();
}
}
// put into app.component.html
<p>
{{newcomponent}}
</p>
<p>
Date : {{todaydate}}
</p>
The most helpful ANGULAR solutions
get computer name angular2ANGULAR Click to see more ... 6.1K 56