[英]AngularJS uib-typeahead appears to break interpolation for rest of page
我遇到了AngularJS 1.50的问题。 在以下代码之后,插值将停止工作。
<input type="text" class="form-control" id="search" name="search"
placeholder="{{ shouldInterpolateButDoesnt }}"
typeahead-on-select="aGreatFunction($item)"
ng-model="selectedDog"
uib-typeahead="dog.label for dog in dogList | filter:$viewValue" typeahead-min-length="1"/>
在呈现的HTML页面上,占位符完整显示{{}}
。 此外,此点之后的所有插值也会中断。
如果我从页面中删除此行,则所有将来的插值都将再次起作用。
我想我已经将问题缩小到uib-typeahead
因为如果我从上面的代码中删除此单个属性,则所有插值均有效。
我尝试按照这篇文章更改模型值: 使用ng-repeat的uib-typeahead不能持久化模型 。 现在,我真的不知所措。
控制台引发以下错误:
angular.js:13236 TypeError: Cannot read property 'exp' of undefined
at watchFnToHumanReadableString (<anonymous>:703:19)
at Scope.$delegate.__proto__.$watch (<anonymous>:735:28)
at new <anonymous> (http://localhost:9000/assets/lib/angular-ui-bootstrap/ui-bootstrap-tpls.js:6318:19)
at Object.invoke (http://localhost:9000/assets/lib/angularjs/angular.js:4604:19)
at extend.instance (http://localhost:9000/assets/lib/angularjs/angular.js:9855:34)
at nodeLinkFn (http://localhost:9000/assets/lib/angularjs/angular.js:8927:34)
at compositeLinkFn (http://localhost:9000/assets/lib/angularjs/angular.js:8226:13)
at compositeLinkFn (http://localhost:9000/assets/lib/angularjs/angular.js:8229:13)
at nodeLinkFn (http://localhost:9000/assets/lib/angularjs/angular.js:8973:24)
at compositeLinkFn (http://localhost:9000/assets/lib/angularjs/angular.js:8226:13) <div class="col-sm-12 col-md-12 main ng-scope" ui-view="content">
解决了问题。 在阅读每个人对我的原始帖子的评论后,我进入控制器以寻找缺少的exp
属性。
不在那里
我搜索了Cannot read property 'exp' of undefined
错误的Cannot read property 'exp' of undefined
找到了这个github页面 。 其他人也有类似的问题,许多人说禁用Batarang扩展程序可以解决此问题。 一位用户发布了一个屏幕快照,该屏幕快照显示他取消了Chrome开发者控制台中的“ Enable
按钮。
我试过了,但是没有用。
要解决此问题,必须转到chrome://extensions
并从那里禁用Batarang。
这解决了问题,但有点不令人满意。 我担心具有Batarang扩展名的最终用户还会看到显示所需插值的页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.