1
我是新來的角2我寫的代碼,用於顯示電影列表中顯示一個清單,但它顯示錯誤,請檢查我的代碼...在納克在角2
下面是我的代碼
component.ts:文件
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:文件
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 { }
它被添加,但得到 – balu
哈其工作非常感謝 – balu
給我從你身邊的任何建議學習角2 – balu