Hi Team
I need some help to create a phone book in Angular and i am allow do this on this page not separate page due to online IDE and its not Angular CLI.
"to create a simple form at the top that allows the user to enter in a first name, last name, and phone number and there should be a submit button. Once the submit button is pressed, the information should be displayed in a list below (automatically sorted by last name) along with all the previous information that was entered. This way the application can function as a simple phone book. When your application loads, the input fields (not the phone book list) should be prepopulated with the following values already:
First name = Coder
Last name = Byte
Phone = 8885559999"
// Code to do this on Angular
/ @ts-ignore
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-area',
template: `
First name
Last name
Phone number
Table of contacts should go here...
`,
styles: []
})
export class MainAppComponent implements OnInit {
// code goes here
ngOnInit() {
}
}
Vishal JoshiRank #377 · 6.7K reputationPosted Mar 7, 2023, 4:07 AM EST
Hello
Please check out below working code sample for your requirment.
https://codepen.io/qujun/pen/KMdPYW
Thanks
Guest UserRank #877 · 2.5K reputationPosted Mar 7, 2023, 4:44 AM EST
Vishal let me work on it, thanks will give feedback if i encounter issues with it.
Guest UserRank #877 · 2.5K reputationPosted Mar 7, 2023, 8:07 AM EST
Hi Vidal
Please advise from the js side where will i insert the javascript code?, i only have that file to work on this is not Angular CLI project its an IDE from online coderbyte excercise.