-
-
Save labidiaymen/20ceddab8dbf00204621cd5c3e12f146 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { UserService } from './user.service'; | |
@Component({ | |
standalone: true, // <- declare component as standalone | |
selector: 'app-user-detail', | |
providers: [UserService], // <- provide te user service directly inside the component | |
templateUrl: './user-detail.component.html', | |
styleUrls: ['./user-detail.component.css'], | |
}) | |
export class UserDetailComponent implements OnInit { | |
user: any; | |
constructor(private userService: UserService) {} | |
ngOnInit() { | |
this.user = this.userService.userProfile(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment