0
を「ヌルのプロパティ 『name』を読み込めません」与えているここで私がダウンして3番目のドロップを行うと、ゾウ、にconsole.log(ブランドを選択すると私のスイッチ/ケースは作業が、コンソールにエラーが
http://codepen.io/TylerL-uxai/pen/ozNgVbをcodepen働いています。名前)は象を言う。それはswitch文の残りの部分を実行します。
しかし、何らかの理由でコンソールエラーが発生しました。
$scope.changedValue3 = function (brand) {
console.log(brand.name); // this isn't null! it returns elephant to console.
switch (brand.name){ // cannot read property name of null
case "elephant":
console.log("worked"); // says "worked" when the code is run
break;
}
}
エラーではありませんあなたはそれが –
であると主張どこゆえ 'null'なので、エラーのプロパティ名を読み取ることができないことはできませんあなたは投稿できますフィドル? –