使用 ngMessage 作为输入类型编号 [英] Using ngMessage for input type number

查看:27
本文介绍了使用 ngMessage 作为输入类型编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何利用 ng-message 作为数字类型?ngMessage 是否支持 max 和 min 属性?如果是这样怎么办?

How to leverage the ng-message for number type? Does ngMessage support max and min attributes? if so how can it be done?

演示链接

来自 angular doc

Example link from angular doc

推荐答案

ngMessages1.3.0-beta.8 版本中作为一个模块正式引入,所以你需要解决以下问题:

ngMessages was officially introduced in version 1.3.0-beta.8 as a module, so you need to fix the following:

  1. 使用 1.3.0-beta.8 或更高版本(现在最新的是 1.3.0-beta.9).

  1. Use version 1.3.0-beta.8 or later (the latest is 1.3.0-beta.9 right now).

在 HTML 中包含 angular-messages[.min].js(它是一个单独的脚本).

Include angular-messages[.min].js in your HTML (it is a separate script).

ngMessages 声明为您的模块/应用程序的依赖项.

Declare ngMessages as a dependency of your module/app.

<小时>

另请参阅此简短演示.

这篇关于使用 ngMessage 作为输入类型编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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