【发布时间】:2017-02-17 20:46:53
【问题描述】:
我是 Angular 新手,在控制台 TypeError 中不断收到以下错误:name.replace is not a function。我不确定到底是什么原因造成的,但它似乎是由 bs-popover 引起的,也许与 snake_case 有关?
我不明白的部分是为什么如果使用 bs-popover 会引发在文本框中使用 popover 的错误,但应用程序的其余部分运行良好并且不会引发错误。
有谁知道此错误消息的原因和可能的修复方法?
HTML:
<input class="form-control" ng-model="chequeValue.BankName" name="BankName"
ng-required='true' data-toggle="tooltip" data-placement="top" title=" {{chequeValue.BankName}}" data-unique="1" data-auto-close="1" data-placement="top" data-content-template="popover-tmpl.html" data-title="Name" data-html="true" bs-popover>
【问题讨论】:
-
TypeError: name.replace is not a function. I'm not sure what's exactly causing it你正在尝试运行.replace,它不是一个函数。bs-popover是什么? -
此错误来自您的 javascript,请发布您的代码。
标签: html angularjs angular-ui-bootstrap popover