【发布时间】:2016-03-13 04:31:03
【问题描述】:
我为我的表达式构建了一个自定义过滤器。它以某种方式起作用。无论如何,我不断收到一个我无法弄清楚为什么的错误? 错误:“TypeError:无法读取属性‘split’ of null”
这是我的过滤器:
LeadApp.filter("q_Filter", function () {
return function (input, splitChar, index) {
if (index === 1) {
q_a = input.split(splitChar);
return q_a[1];
}
else {
q_a = input.split(splitChar);
return q_a[0];
}
};
});
这里是视图:
<tr ng-repeat="select in lead_selection" ng-show="select.length && $index > 4">
<td>
<i class="fa fa-circle-thin"></i>
<strong>{{ select | q_Filter:' | ':0 | uppercase }}</strong> <br />
<p class="p-l-1">{{ select | q_Filter:' | ':1 }}</p>
</td>
</tr>
【问题讨论】:
标签: javascript angularjs