与Angular 2一起使用时,我在Edge中有两个问题:
请检查此Plunker: https://plnkr.co/edit/MdNOlv?p=preview
//our root app component
import {Component, Directive, Output, EventEmitter, Input, SimpleChange} `from 'angular2/core'`
import {Observable} from 'rxjs/Observable';
import {Observer} from 'rxjs/Observer';
//import 'rxjs/Rx';
@Component({
selector: 'my-app',
template:`
<h1>Selecting Number</h1>
<select type="number" [(ngModel)]="levelNum" (ngModelChange)="toNumber()">
<option *ngFor="#level of levels" [ngValue]="level.num">{{level.name}}</option>
</select>
{{levelNum}}
`,
})
export class App {
levelNum:number;
levels:Array<Object> = [
{num: 0, name: "AA"},
{num: 1, name: "BB"}
];
toNumber(){
this.levelNum = +this.levelNum;
console.log(this.levelNum);
}
}
答案 0 :(得分:0)
将Angular更新为Beta 16后,此问题已得到解决。