admin管理员组文章数量:1334322
I am getting this error in browser:
Error: [$interpolate:interr] Can't interpolate:
{{ displayName(stream.StreamName) }}
TypeError: undefined is not a function
.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)
}
});
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/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)
}
});
Share
Improve this question
asked Dec 30, 2014 at 22:48
NiTiNNiTiN
1,0221 gold badge16 silver badges25 bronze badges
1 Answer
Reset to default 8"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.
本文标签: javascriptAngularJS can39t interpolate errorStack Overflow
版权声明:本文标题:javascript - AngularJS can't interpolate error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742234697a2437862.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论