Angular TypeError:name.replace不是bs-popover

时间:2017-02-15 10:04:22

标签: html angularjs angular-ui-bootstrap popover

我是angular的新手,并且在控制台TypeError中不断出现以下错误:name.replace不是函数。我不确定究竟是什么引起了它,但它似乎是由bs-popover引起的,也许与snake_case有关?

我不明白的部分是为什么如果使用bs-popover会导致在文本框中使用popover的错误,但应用程序的其余部分运行正常并且不会抛出错误。

有谁知道此错误消息的原因和可能的修复方法?

enter image description here

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>

2 个答案:

答案 0 :(得分:0)

你不能在角度表达中有空格

title=" {{chequeValue.BankName}}"

我不确定这是不是问题。进一步查看文档并更新到uib-popover

https://angular-ui.github.io/bootstrap/#popover

答案 1 :(得分:0)

我找到了回答我的问题。而不是使用角带进行弹出,最好使用ui-bootstrap的bootstrap popover。

<input class="form-control" ng-model="chequeValue.BankName" popover='{{chequeValue.BankName}}' data-placement="top" title=" {{chequeValue.BankName}}" popover-trigger="focus" popover-auto-close="outsideClick" popover-placement="top" popover-title="Drawee Bank Name">