我遇到了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
,因为如果从上面的代码中删除此单个属性,则所有插值都可以。
我尝试根据这篇文章更改模型值:Model does not persist using uib-typeahead with ng-repeat。现在,我真的不知道下一步该去哪里。
Console会抛出以下错误:
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">
答案 0 :(得分:-1)
解决了这个问题。在阅读了所有人对我原来帖子的评论后,我挖掘了我的控制器,寻找失踪的exp
财产。
它不存在。
我搜索了Cannot read property 'exp' of undefined
错误,找到了this github page。其他人也有类似的问题,许多人说禁用Batarang扩展解决了这个问题。一位用户发布了他的屏幕截图,取消选中Chrome开发者控制台中的Enable
按钮。
我尝试了这个,但它没有用。
要解决此问题,必须转到chrome://extensions
并从那里停用Batarang。
这解决了问题,但有点不满意。我担心具有Batarang扩展名的最终用户也会看到一个页面,其中显示了所需的插值。