Skip to content

Commit e76d75f

Browse files
committed
using $interpolate to retrieve form names
1 parent beda001 commit e76d75f

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
### 2.1.0
2+
3+
* Enhancements
4+
* Using `$interpolate` to retrieve the name of the input element. This allows the directive to work with interpolated form names. Thanks @cherrydev and @Templarian
5+
16
### 2.0.0
27

38
* Breaking Changes
49
* Added a more specific selector query for the input element. The input element must now also have the 'form-control' class associated with it. Thanks @martindederer
510

611
* Enhancements
7-
* Added `trigger` option to provide a custom trigger to validate the value. By default the trigger is the `blur` event. Thanks @TEmplarian
12+
* Added `trigger` option to provide a custom trigger to validate the value. By default the trigger is the `blur` event. Thanks @Templarian
813

914
### 1.1.0
1015

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-bootstrap-show-errors",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"authors": [
55
"Paul Yoder <paulyoder@gmail.com>"
66
],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-bootstrap-show-errors",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "An Angular Directive to intelligently show form validation errors",
55
"author": "https://github.com/paulyoder/angular-bootstrap-show-errors/graphs/contributors",
66
"license": "MIT",

src/showErrors.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
showErrorsModule = angular.module('ui.bootstrap.showErrors', [])
22

33
showErrorsModule.directive 'showErrors',
4-
['$timeout', 'showErrorsConfig', ($timeout, showErrorsConfig) ->
4+
['$timeout', 'showErrorsConfig', '$interpolate', ($timeout, showErrorsConfig, $interpolate) ->
55

66
getTrigger = (options) ->
77
trigger = showErrorsConfig.trigger
@@ -23,7 +23,7 @@ showErrorsModule.directive 'showErrors',
2323

2424
inputEl = el[0].querySelector '.form-control[name]'
2525
inputNgEl = angular.element inputEl
26-
inputName = inputNgEl.attr 'name'
26+
inputName = $interpolate(inputNgEl.attr('name') || '')(scope)
2727
unless inputName
2828
throw "show-errors element has no child input elements with a 'name' attribute and a 'form-control' class"
2929

src/showErrors.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)