Skip to content

Commit

Permalink
Updated example with 'beth-class' examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rumd3x committed Jun 16, 2018
1 parent 7e3a34a commit c9038ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions example/form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.pink-text {
color: pink;
}

.blue-text {
color: blue;
}

.grey-text {
color: grey;
}
4 changes: 3 additions & 1 deletion example/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<meta name="author" content="RUMD3X">
<meta name="description" content="Beth.js Example">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<link rel="stylesheet" href="form.css">
<script src="jquery-3.3.1.min.js"></script>
<script src="../beth.js"></script>
</head>
Expand All @@ -31,7 +33,7 @@ <h4>Beth Dynamic Inputs!</h4>
<input beth-bind="instance.tests.radio" type="radio" name="gender" value="male"> Male<br>
<input beth-bind="instance.tests.radio" type="radio" name="gender" value="female"> Female<br>
<input beth-bind="instance.tests.radio" type="radio" name="gender" value="other"> Other<br>
Selected input value => {{instance.tests.radio}}
Selected input value => <span class="border" beth-class="instance.tests.radio === 'male' ? 'blue-text border-primary' : (instance.tests.radio === 'female' ? 'pink-text border-secondary' : 'grey-text')">{{instance.tests.radio}}</span>

<br>
<br>
Expand Down

0 comments on commit c9038ce

Please sign in to comment.