Reputation: 1022
I am getting this error in browser:
Error: [$interpolate:interr] Can't interpolate:
{{ displayName(stream.StreamName) }}
TypeError: undefined is not a function
http://errors.angularjs.org/1.2.25/$interpolate/interr?p0=%0A%20%20%20%20%2…0A%20%20%20%20%20%20&p1=TypeError%3A%20undefined%20is%20not%20a%20function
Code is pretty simple, here is the HTML:
<div class="card" ng-repeat="stream in streams">
<div class="item item-divider">
{{ displayName(stream.StreamName) }}
</div>
<ion-list>
<div class="item " ng-repeat="(key, value) in stream">
{{key}}
<p>
{{value}}
</p>
</div>
</ion-list>
And here is the Controller javascript code:
angular.module('starter')
.controller('StreamsCtrl', function ($scope, $timeout) {
$scope.displayName = function(s) {
return s.subString(s.lastIndexOf('/')+1)
}
});
Upvotes: 3
Views: 5270
Reputation: 1022
"can't interpolate" wording overwhelmed me :)
When I tried to console.log(), it wouldn't work... and problem was, I misspelled javascript subString()
. Its not capitalized, its substring()
.
Only reason to write this question and answer so others know that when you get 'interpolation error', it could be as simple as javascript typo.
Upvotes: 8