错误:未定义不是对象(正在评估“ $ scope。$ storage.match_id”)

时间:2018-10-10 13:46:26

标签: angularjs

我已经在网上浏览了好几个小时,但找不到任何解决方案。我将Angular与LocalStorage一起使用来获取match_id。

我有以下代码段,这使我Error: undefined is not an object (evaluating '$scope.$storage.match_id')

app.controller('confirmMatchCtrl', ["$scope", "$filter", "$routeParams", "$translate", "$location", "Data", "$http", "onlineStatus", "$localStorage",
function ($scope, $filter, $routeParams, $translate, $location, Data, $http, onlineStatus, $localStorage) {
    var id = $scope.$storage.match_id;

也许有人有主意吗?

谢谢

1 个答案:

答案 0 :(得分:0)

您需要先分配存储空间,并另外进行一次null / undefined检查,以避免这种情况。

import pandas as pd

# read file
df = pd.read_excel('file.xlsx')

# extract value
val = df.at['N of extremum', 'Curve 1']