AngularStrap 工具提示禁用我的自定义指令 [英] AngularStrap tooltip disables my custom directive

查看:20
本文介绍了AngularStrap 工具提示禁用我的自定义指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让 bs-tooltip AngularStrap 指令与我自己的名为checkStrength"的自定义指令一起使用,该指令可检查密码的强度.单独使用这些指令中的任何一个时,它们都可以正常工作,但不能一起使用.

I am trying to get the bs-tooltip AngularStrap directive to work with my own custom directive called "checkStrength" which checks the strength of a password. When using either of these directives alone, they work fine, but they won't work together.

这是一个带有 bs-tooltip 的 plunker.工具提示工作正常,但我的自定义checkStrength"指令不起作用.

This is a plunker with the bs-tooltip. The tooltip works fine but my custom "checkStrength" directive does not work.

这是一个没有 bs-tooltip 的 plunker.在这种情况下,checkStrength"指令工作正常.

This is a plunker without the bs-tooltip. In this case the "checkStrength" directive works fine.

我做错了什么?

推荐答案

在输入元素上,您必须使用以下内容:

On your input element you have to use the following:

ng-model="$parent.pw"

bs-tooltip 在其绑定到的元素上创建一个隔离的作用域.

bs-tooltip creates an isolated scope on the element its bound to.

工作示例:Plunker

这篇关于AngularStrap 工具提示禁用我的自定义指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆