Ng show if the variable is a number

angularjs, angularjs-directive

Solution

Add to your scope:

$scope.isNumber = angular.isNumber;

and then use:

ng-show="isNumber(10)"

http://jsfiddle.net/88wqe/

Problem

I want to display an element only if a value is a number. How to do this? I tried : - `ng-show='angular.isNumber(10)'` - `ng-show='isNumber(10)'`

Original source

Related problems