-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
97 lines (91 loc) · 2.63 KB
/
example.html
File metadata and controls
97 lines (91 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!doctype html>
<html lang="en" ng-app="app">
<head>
<meta charset="utf-8">
<title>Token Input Demo</title>
<link rel="stylesheet" href="src/token-input.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<style>
.token-input {
position: relative;
height: auto;
min-height: 34px;
padding: 0 6px;
overflow: hidden;
cursor: text;
}
.token-input-token,
.token-input-input {
display: inline-block;
float: left;
line-height: 18px;
padding: 0 5px;
margin: 6px;
font-size: 14px;
}
.token-input-token {
line-height: 18px;
padding: 2px 5px;
margin: 4px;
background-color: #eee;
border: 1px solid #ccc;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.token-input-token-remove:before {
content: "×";
margin: 0 0 0 3px;
font-weight: bold;
}
.token-input-input,
.token-input-placeholder {
line-height: 24px;
padding: 0 5px;
margin: 4px;
}
.token-input-placeholder {
position: absolute;
color: #999;
}
</style>
</head>
<body>
<div class="container" ng-controller="Controller">
<h1>Token Input Demo</h1>
<div class="row">
<form class="col-md-6" novalidate name="form" ng-submit="submit()">
<div class="form-group">
<label>Before Input:</label>
<input class="form-control" type="text" placeholder="Generic text">
</div>
<div class="form-group">
<label for="tag-input">Interest Tags:</label>
<div class="form-control" id="tag-input" name="interests" sb-free-token-input ng-model="obj.interests" placeholder="Search for you interestes" sb-maxlength="3"></div>
</div>
<pre>
Value: {{obj.interests|json}}
Errors: {{form.interests.$error|json}}
</pre>
<div class="form-group">
<label>After Input: </label>
<input class="form-control" type="text">
</div>
<input class="btn btn-default" type="submit">
</form>
</div>
</div>
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-sb-measure-text/measure-text.js"></script>
<script src="src/token-input.js"></script>
<script>
angular.module('app', ['sbTokenInput']).
controller('Controller', function ($scope) {
$scope.obj = { interests: ['bird', 'fish'] };
$scope.submit = function () {
console.log('submit');
}
});
</script>
</body>
</html>