These are chat archives for AngularClass/angular2-webpack-starter

7th
Jun 2017
texirv0203
@texirv0203
Jun 07 2017 00:57

i am trying to learn angular2
i read through ngFor documentation but not sure how to display the liArraycontent values.
can you guys tell me how to display it.
providing my code below
http://plnkr.co/edit/8SzOc9GfgzvCBb7Fifvg?p=preview&open=app%2Fapp.component.ts

import { Component } from '@angular/core';

@Component({
selector: 'my-app',
template: <ul class= "master"> <li *ngFor ="let student of liArraycontent"> </li> </ul>
})
export class AppComponent {
name = 'Angular';
liArraycontent = ["testing 1", "testing 2", "testing3"]

}

/
Copyright 2017 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
/

Dan Cancro
@dancancro
Jun 07 2017 01:30
@texirv0203 you left out the values from the template. Try this: <li *ngFor ="let student of liArraycontent"> {{student}} </li>