Completely new to Angular and Javascript. I recently received an assignment for my angular.js class where I need to work on a code hint and make a simple form. The code hint provided is as follows:
export class AppComponent {
items:Array<any>
constructor() {
this.items = [];
this.addItems();
}
I'm having trouble understanding the "items:Array" part and how it functions. How can I go about creating a basic form? Whenever I attempt to make changes, my app.module.ts stops working, which has never been an issue before.
This is what I have so far:
@Component({
selector: 'app-root',
template: `
<h1> First Name: <input [(ngModel)]="items"> </h1>
<ul *ngFor="let item of items;let i = index">
<li>{{i}}: {{item.num}} <input type='button' value='delete' (click)=removeItem(item)></li>
</ul>
`,
})