Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 0200f24

Browse files
author
Nick Litwin
committed
Add ability to change type and pattern of tc-input
1 parent cba390d commit 0200f24

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/directives/tc-input/tc-input.directive.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
scope: {
1111
labelText: '@',
1212
placeholder: '@',
13-
inputValue: '='
13+
inputValue: '=',
14+
inputName: '@',
15+
inputType: '@',
16+
inputPattern: '='
17+
},
18+
link: function(scope, element, attrs) {
19+
if (!scope.inputType) {
20+
scope.inputType = 'text';
21+
}
1422
}
1523
}
1624
}

app/directives/tc-input/tc-input.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
label.tc-label {{labelText}}
22

3-
input(type="text", placeholder="{{placeholder}}", ng-model="inputValue")
3+
input(name="{{inputName}}", type="{{inputType}}", placeholder="{{placeholder}}", ng-model="inputValue", ng-pattern="inputPattern")

0 commit comments

Comments
 (0)