JavaScriptが分かります。私はTypescriptを学んでいるだけで、これは私にエラーを与えます: "Error:ReferenceError:代入の左手が無効です"。どうしましたか?Error:ReferenceError:代入の左辺が無効
import { Component } from '@angular/core';
import { Fruit } from './fruit';
import { PartComponent } from './part.component';
import { ByKindPipe } from './by-kind.pipe';
@Component({
selector: 'my-app',
templateUrl: 'app/app.html',
directives:[PartComponent],
pipes: [ByKindPipe],
styles: ['div { color: blue; }']
})
export class AppComponent {
// this works
fruits: Fruit[] = [
{"name": "apple", "kind": "tree"},
{"name": "orange", "kind":"tree"},
{"name": "strawberry", "kind": "berry"},
{"name": "pear", "kind": "tree"}];
// this works
things: string[] = ["a","b"];
// this doesn't work
things[1] = "c";
}
クラス本体の内部でこのplunk
あなたは何が起こっているのかを理解するためにここに完全な文脈を含める必要があります。 –
それは塊の中にあります –
あなたは完全な文脈** here **を含める必要があります。 –