我试图迭代一个JSON对象userTypes.
对于以下代码:
在第1 ng-repeat:
{{user.type}}输出'Parent'(如预期的那样),
{{user.options}}输出'[{"option1":"11QWERT","option2":"22QWERT"}]'(如预期的那样).
但在第二ng-repeat,我无法迭代user.options并输出每一个{{options}}
什么应该改变,以获得第二个option1和option2作为输出 ng-repeat?
JS片段
var userTypes = [{
"type": 'Parent',
"options": [{
"option1": "11QWERT",
"option2": "22QWERT"
}]
}]
Run Code Online (Sandbox Code Playgroud)
HTML片段
<li ng-repeat="user in userTypes">
<p>{{user.type}}</p>
<p>{{user.options}}</p>
<li ng-repeat="option in user.options">
<p>
{{option}}
</p>
</li>
</li>
Run Code Online (Sandbox Code Playgroud) 我不知道为什么我的“开始”pred 不能工作。我只是在 pd.to_datetime 上添加了一些编辑,但没有任何效果。我很困惑如何解决这个问题。这是我的代码
pred = results.get_prediction(start=pd.to_datetime('2018-06-01'), dynamic=False)
pred_ci = pred.conf_int()
ax = y['2015':].plot(label='observed')
pred.predicted_mean.plot(ax=ax, label='One-step ahead Forecast', alpha=.7, figsize=(14, 4))
ax.fill_between(pred_ci.index,
pred_ci.iloc[:, 0],
pred_ci.iloc[:, 1], color='k', alpha=.2)
ax.set_xlabel('Date')
ax.set_ylabel('Retail_sold')
plt.legend()
plt.show()
Run Code Online (Sandbox Code Playgroud)
并且我的错误日志总是参考我的时间格式,我不得不重新采样我的数据,从每日数据到每月数据,然后再开始数据分析和解决数据,但我不知道为什么我的数据不能使用 pd.todatetime 读取。
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
pandas/_libs/index.pyx in pandas._libs.index.DatetimeEngine.get_loc()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
KeyError: 1546300800000000000
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2896 try:
-> 2897 return self._engine.get_loc(key) …Run Code Online (Sandbox Code Playgroud) 在运行ngrok并转到建议的URL时,我进入
GET /favicon.icon 404 error了ngrok.
ngrok在哪个文件夹中搜索favicon.ico文件?
我该如何解决 ?
对ngrok来说很新.帮帮我吧
提前致谢
我有一个directive要重用的元素。
但background-color需要根据用途进行改变。因此,每次调用时,
都需要将类动态注入到 中。directivedirective
directive名字是tabset
选项卡集模板:
<ul>
........ HTML STUFF .......
</ul>
Run Code Online (Sandbox Code Playgroud)
我需要向这个<ul>标签添加类。
attribute我更喜欢关于创建可以传递给指令的指令的行的答案tabset。如下所示:
第一个例子
<tabset colorblack>
</tabset>
Run Code Online (Sandbox Code Playgroud)
第二个例子
<tabset colororange>
</tabset>
Run Code Online (Sandbox Code Playgroud)
其中colorblack和colororange是属性directives。
如果这样的事情不可能,那么请建议正确的答案,
并且请注意:
尽管我已经提到了更改颜色,但当涉及到实时时,它不仅仅是更改颜色,所以我绝对需要传入class.
如果问题不清楚,请告诉我。提前致谢
我想减少通过该宽度col-md-offset-1的自举分配margin-left在某个地方.我希望通过使用LESS来完成.