Is there a way to use angular.isString
for comparison within an ng-if in an ng-repeat loop? Currently, all items in the array are being returned.
I attempted to simply display the result of angular.isString
, but no output is generated.
This is my desired functionality:
<li ng-repeat="item in data">
<div ng-if="angular.isString(item)">
{{ item }}
</div>
</li>
function MyCtrl($scope)
{
$scope.data =
[
"Hello",
"-",
123
];
}
View the fiddle here: http://jsfiddle.net/m6k13whh/2/