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: `
Table of contacts should go here...
`,
styles: []
})
export class MainAppComponent implements OnInit {
// code goes here
ngOnInit() {
}
}3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Guest UserPosted Mar 7, 2023, 1:07 PM
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.
Guest UserPosted Mar 7, 2023, 9:44 AM
Vishal let me work on it, thanks will give feedback if i encounter issues with it.
Vishal JoshiPosted Mar 7, 2023, 9:07 AM
Hello
Please check out below working code sample for your requirment.
https://codepen.io/qujun/pen/KMdPYW
Thanks