projects
/
angular-drzb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
774e901
)
make placeholder optional
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 24 Jan 2013 00:41:35 +0000
(
01:41
+0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 24 Jan 2013 00:41:35 +0000
(
01:41
+0100)
app/js/directives.js
patch
|
blob
|
history
diff --git
a/app/js/directives.js
b/app/js/directives.js
index
88d5653
..
67bec43
100644
(file)
--- a/
app/js/directives.js
+++ b/
app/js/directives.js
@@
-42,8
+42,9
@@
angular.module('myApp.directives', []).
' <div class="control-group">'+
' <label class="control-label" for="'+m+'">'+attrs.label+'</label>'+
' <div class="controls">'+
-' <input type="'+my_type+'" id="'+m+'" ng-model="'+m+'"
placeholder="'+attrs.placeholder+'"'
+' <input type="'+my_type+'" id="'+m+'" ng-model="'+m+'"
';
;
+ if ( attrs.placeholder ) html += ' placeholder="' + attrs.placeholder + '"';
if ( attrs.ngRequired ) html += ' ng-required="' + attrs.ngRequired + '"';
html += '>'+
' </div>'+