2
我做錯了什麼?我得到」EXCEPTION:模板解析錯誤:無法綁定到'ngValue',因爲它不是知原生屬性」無法綁定到'ngValue',因爲它不是已知的本地屬性「
import {Component, Optional, Inject} from 'angular2/core';
@Component({
selector: 'm-Cities',
template: `
<select [(ngModel)]="selectedCity" style="margin-left: 30px; width:120px; height: 50px; padding-left: 50px;">
<option *ngFor="#city of cities" [ngValue]="city">{{city.name}}</option>
</select>
`,
providers: [],
directives: [],
pipes: []
})
export class Mcities{
selectedCity: Object;
cities: Object[] = [
{name: "SF"},
{name: "NYC"}
];
constructor() {}
}
我使用RC3和它的工作不適合我 – Gab