We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { Component, OnInit } from '@angular/core'; import { EventService } from './Shared/event.service';
<p> {{newcomponent}} </p> <p> Today's Date : {{todaydate}} </p>
import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class EventService { constructor() { } showTodayDate() { const ndate = new Date(); return ndate; } }
The text was updated successfully, but these errors were encountered:
duplicated #288
Sorry, something went wrong.
closed as this is a copy-paste duplicate of #348
No branches or pull requests
Uncaught Error: Can't resolve all parameters for EventsListComponent: (?).
at syntaxError (compiler.js:2193)
Component
import { Component, OnInit } from '@angular/core';
import { EventService } from './Shared/event.service';
@component({
selector: 'app-events-list',
template:
<p> {{newcomponent}} </p> <p> Today's Date : {{todaydate}} </p>
})
export class EventsListComponent implements OnInit {
public todaydate;
newcomponent = 'Entered in new component created';
constructor(private myservice: EventService) {}
ngOnInit() {
this.todaydate = this.myservice.showTodayDate();
}
}
Service
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class EventService {
constructor() { }
showTodayDate() {
const ndate = new Date();
return ndate;
}
}
The text was updated successfully, but these errors were encountered: