我收到语法错误:
Uncaught SyntaxError: missing ) after argument list
从这个AngularJS代码:
dataProvider.CustomAssets.save({ 'product' : product.id,'store' : store.id }) .then(function(asset){ $scope.product.assets.key.push( name : asset[0],additionalPrice : asset[1],file : asset[2],attribute : asset[3] ); }) .catch(function(error){ $log.error(error); });
解决方法
你忘了用{}包装对象.
$scope.product.assets.key.push( name : asset[0],attribute : asset[3] );
试试这个
$scope.product.assets.key.push({ name : asset[0],attribute : asset[3] });