AngularJS ng-show not firing when used with map <p>Trying to use a key/value map to determine if an angular controlled element should be displayed : </p> <p><a href="http://jsfiddle.net/9fR23/181/" rel="nofollow">http://jsfiddle.net/9fR23/181/</a></p> <p>But I receive a exception : </p> <pre><code>angular.js:6173 TypeError: fnPtr is not a function at Object.elementFns [as get] (angular.js:6802) at Object.$get.Scope.$digest (angular.js:8563) at Object.$get.Scope.$apply (angular.js:8771) at angular.js:986 at Object.invoke (angular.js:2873) </code></pre> <p>Using scope in this way is not illegal ? How to use a key/value map to determine if element should be displayed ? This map will be updated at runtime, so to ensure this update is reflected on UI I need to include <code>apply()</code> method ?</p> <p>fiddle code : </p> <pre><code>&lt;div ng-app="myapp" ng-controller="FirstCtrl"&gt; &lt;table class="table table-striped"&gt; &lt;tr ng-repeat="person in people"&gt; &lt;td ng-show="errorMap('1')"&gt;{{ person.first + ' ' + person.last }}&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; var myapp = angular.module('myapp', []); myapp.controller('FirstCtrl', function ($scope) { var errorMap = new Object() errorMap['1'] = 'true' errorMap['2'] = 'false'; $scope.errorMap = errorMap $scope.people = [ { id: 1, first: 'John', last: 'Rambo' }, { id: 2, first: 'Rocky', last: 'Balboa' }, { id: 3, first: 'John', last: 'Kimble' }, { id: 4, first: 'Ben', last: 'Richards' } ]; }); </code></pre>