/ / exibir uma lista em ng para em angular 2 - angular

exibir uma lista em ng para em angular 2 - angular

Eu sou mais novo para angular 2 eu escrevi o código para exibir a lista de filmes, mas exibindo um erro, por favor, verifique o meu código ...

abaixo está meu código

component.ts: file

import { Component} from "@angular/core";
@Component({
selector:"my-app",
template:`<h1>welcome to my shop</h1>
<p>we have the following movies available</p>
<div>
<p *ngfor=#movie of movieList>{{movie}}</p>
</div>`
})
export class MyShopComponent{
public movieList=["batman vs superman","civil war","deadpool"]
}

app.module.ts: file

import { NgModule }      from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { FormsModule }   from "@angular/forms";
import { MyShopComponent }  from "./app.component";
@NgModule({
imports: [
BrowserModule,
FormsModule
],
declarations: [
MyShopComponent
],
bootstrap: [ MyShopComponent ]
})
export class AppModule { }

Respostas:

5 para resposta № 1

Modelo de componente interno ngFor Deveria usar let para definir a variável iterável atual. Também erro correto de *ngfor para *ngFor com o atributo wrapping por "

<p *ngFor="let movie of movieList">{{movie}}</p>

Demo Plunkr