From 685405d35c0f56ec774232bdfd8f10d4fb8ec733 Mon Sep 17 00:00:00 2001 From: Gary Forster Date: Thu, 20 Oct 2016 11:33:35 +0100 Subject: [PATCH] feat: allow specification of maxlength from textarea element --- dist/formly-material.js | 5 ++++- docs/types/textarea.md | 5 +++++ src/types/textarea/textarea.js | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dist/formly-material.js b/dist/formly-material.js index 2b48876..af43de6 100644 --- a/dist/formly-material.js +++ b/dist/formly-material.js @@ -947,6 +947,9 @@ return /******/ (function(modules) { // webpackBootstrap }, cols: { attribute: 'cols' + }, + maxlength: { + attribute: 'md-maxlength' } }, templateOptions: { @@ -984,4 +987,4 @@ return /******/ (function(modules) { // webpackBootstrap /***/ } /******/ ]) }); -; \ No newline at end of file +; diff --git a/docs/types/textarea.md b/docs/types/textarea.md index 0b2690e..6e74f9c 100644 --- a/docs/types/textarea.md +++ b/docs/types/textarea.md @@ -29,6 +29,11 @@ textarea #### templateOptions.className _: string | expression | array_ +#### templateOptions.maxlength *: integer* + +The maximum number of characters allowed in this input. If this is specified, a character counter will be shown underneath the input. +Equivalent to md-maxlength + #### templateOptions.rows *: integer* Number of rows diff --git a/src/types/textarea/textarea.js b/src/types/textarea/textarea.js index 26b8aa8..6c2bf3a 100644 --- a/src/types/textarea/textarea.js +++ b/src/types/textarea/textarea.js @@ -16,6 +16,9 @@ export default (formlyConfigProvider) => { }, cols: { attribute: 'cols' + }, + maxlength: { + attribute: 'md-maxlength' } }, templateOptions: {