标签云

微信群

扫码加入我们

WeChat QR Code


Your second attempt will work. If it doesn't then there's some other issue.

2018年09月26日50分01秒

Kami: That's different. He's trying to remove a key/value pair from a plain object that happens to be in an Array.

2018年09月26日50分01秒

And the first one would work if you had quotes around first. E.g., both delete $scope.quotes[0]['first']; and delete $scope.quotes[0].first; are correct.

2018年09月26日50分01秒

$scope = {}; $scope.quotes = [ { 'quote': 'foo', 'author': 'bar', 'source': 'foobar', 'first': 'slideout', } ]; delete $scope.quotes[0]["first"]; $scope.quotes[0]; // What you have should work.

2018年09月26日50分01秒