小编Ait*_*tor的帖子

为什么ng-mouseover不适用于ng-if

我正在尝试在具有"ng-if"的图像上使用"ng-mouseover"指令并且它不起作用但是如果我使用"ng-show"指令它可以工作,大家能告诉我为什么吗?或者这是一个AngularJS问题?

在AngularJS文档中,我无法阅读有关它的任何内容:https://docs.angularjs.org/api/ng/directive/ngMouseover

NG-秀

<button ng-show="true" ng-mouseover="countOne = countOne + 1" ng-init="countOne=0">
Increment (when mouse is over)
</button>
Count: {{countOne}}
Run Code Online (Sandbox Code Playgroud)

NG-如果

<button ng-if="true" ng-mouseover="countTwo = countTwo + 1" ng-init="countTwo=0">
Increment (when mouse is over)
</button>
Count: {{countTwo}}
Run Code Online (Sandbox Code Playgroud)

小提琴:http://plnkr.co/edit/Wb6bjyJdHj5qoH7fxGFJ?p = info

angularjs angularjs-ng-show angularjs-ng-if

5
推荐指数
1
解决办法
2120
查看次数

使用 Angular Translate 在中继器上连接字符串

我想在“小”标签内使用 Angular Translate 在中继器上连接一个字符串来放置描述。我应该做什么?

<li ng-repeat="subtype in type">
    <label>
        <input type="radio" name="radioType" ng-value="subtype" ng-model="dialogModel.type"> 
        {{ subtype.name }} <small>{{ 'subtype.name + "_DESCRIPTION"' | translate }}</small>
    </label>
</li>
Run Code Online (Sandbox Code Playgroud)

现在它向我显示了一个文字字符串,我不知道如何连接一个 Angular Translate 字符串。

angularjs angular-translate

4
推荐指数
1
解决办法
5432
查看次数

使用自定义字段从表单创建mailto

我有一个包含3个字段(名称,电子邮件和消息)的HTML表单,我想用这3个字段创建自定义mailto,但我不想创建这样的固定内容:

<a href="mailto:mail@company.com?subject=Subject&body=HelloWorld">Send a mail</a>

这可能吗?如果不是,我还有另一种方法来做一个简单的处方集吗?我的页面是一个登陆页面,只有HTML,CSS和一些JavaScript(Bootstrap).

---编辑---

我发现了这个,例如:http://www.techrepublic.com/article/set-up-an-html-mailto-form-without-a-back-end-script/

但它在体内写了太多信息,结果是文字的:

Name=Your name
E-mail=mail@company.com
Comment=Testing textarea 
Submit=Submit
Run Code Online (Sandbox Code Playgroud)

html javascript forms mailto

4
推荐指数
1
解决办法
2596
查看次数