Created
April 7, 2016 08:20
-
-
Save khades/4462ab44838ace8eb5c77d9080308151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var InputComponent = { | |
view: function(ctrl, args) { | |
return m(".pure-control-group", { | |
class: !!args.error && args.error() != null ? "has-error" : "" | |
},[ | |
m("label", { | |
for: args.id | |
}, args.label), | |
m("input.pure-input-1", { | |
id: args.id, | |
type: "text", | |
oninput: m.withAttr("value", (!!args.oninput) ? args.oninput : args.value), | |
value: args.value() | |
}), | |
!!args.error && args.error() != null ? m("span.help-block",args.error()) : null | |
]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment