Simple question- if I have this in my controller:
$scope.somedata = \'Item 1, Item 2\'; // set from something else
is there a way to split some
commented delimiter here
angular.module('myFilters', []). filter('split', function() { return function(input, delimiter) { //var delimiter = delimiter || ','; return input.split(delimiter); } });
You could use the filter like so: also added track by $index to avoid crash due to duplicate values
0 讨论(0) 查看其它3个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复